kernel/private/rest/classes/request/rest_request.php
public function getParsedBody()
    {
        if ( $this->originalProtocol === 'http-post' )
        {
            if ( strpos( $this->raw['CONTENT_TYPE'], 'application/json' ) === 0 )
            {
                return json_decode( $this->body, true );
            }
            return $this->post;
        }
        if ( !isset( $this->raw['CONTENT_TYPE'] ) )
            return null;

        if ( empty( $this->body ) )
            return array();

        if ( strpos( $this->raw['CONTENT_TYPE'], 'application/x-www-form-urlencoded' ) === 0 )
        {
            parse_str( $this->body, $parsedBody );
            return $parsedBody;
        }
        else if ( strpos( $this->raw['CONTENT_TYPE'], 'application/json' ) === 0 )
        {
            return json_decode( $this->body, true );
        }
        return null;
    }
public function getParsedBody()
    {
        if ( $this->originalProtocol === 'http-post' )
        {
            if ( strpos( $this->raw['CONTENT_TYPE'], 'application/json' ) === 0 )
            {
                return json_decode( $this->body, true );
            }
            return $this->post;
        }
        if ( !isset( $this->raw['CONTENT_TYPE'] ) )
            return null;

        if ( empty( $this->body ) )
            return array();

        if ( strpos( $this->raw['CONTENT_TYPE'], 'application/x-www-form-urlencoded' ) === 0 )
        {
            parse_str( $this->body, $parsedBody );
            return $parsedBody;
        }
        else if ( strpos( $this->raw['CONTENT_TYPE'], 'application/json' ) === 0 )
        {
            return json_decode( $this->body, true );
        }
        return null;
    }
public function getParsedBody ( ) { if ( $ this -> originalProtocol === 'http-post' ) { if ( strpos ( $ this -> raw [ 'CONTENT_TYPE' ] , 'application/json' ) === 0 ) { return json_decode ( $ this -> body , true ) ; } return $ this -> post ; } if ( ! isset ( $ this -> raw [ 'CONTENT_TYPE' ] ) ) return null ; if ( empty ( $ this -> body ) ) return array ( ) ; if ( strpos ( $ this -> raw [ 'CONTENT_TYPE' ] , 'application/x-www-form-urlencoded' ) === 0 ) { parse_str ( $ this -> body , $ parsedBody ) ; return $ parsedBody ; } else if ( strpos ( $ this -> raw [ 'CONTENT_TYPE' ] , 'application/json' ) === 0 ) { return json_decode ( $ this -> body , true ) ; } return null ; }
Get parsed request body based on content type as a php hash.

Only supports application/x-www-form-urlencoded and application/json,
for anything else use ->body atm. If POST then ->post is returned.

@todo Add some sort of configurable lazy loaded request body handler for parsing misc content type.
@return array|null Null on unsupported content type.
Get parsed request body based on content type as a php hash .