core/Http/Request.php
public function readJson($check_header = true, $override = false)
	{
		if( !is_null($this->from_json) && !$override )
		{
			return $this->from_json;
		}

		// set false json reader
		$this->from_json = false;

		if( $check_header )
		{
			$type = $this->server->getIs("CONTENT_TYPE") ? $this->server->get("CONTENT_TYPE") : $this->server->getOr("HTTP_ACCEPT", '');
			if( ! preg_match('/(?:application|text)\/json(?:$|;| )/', $type) )
			{
				return false;
			}
		}

		$body = $this->body();
		if( strlen($body) && ( $body[0] === "{" || $body[0] === "[" ) )
		{
			$this->params_post = new Collection( Json::parse($body, true) );
			$this->body = '';
			$this->from_json = true;
		}

		return $this->from_json;
	}
public function readJson($check_header = true, $override = false)
	{
		if( !is_null($this->from_json) && !$override )
		{
			return $this->from_json;
		}

		// set false json reader
		$this->from_json = false;

		if( $check_header )
		{
			$type = $this->server->getIs("CONTENT_TYPE") ? $this->server->get("CONTENT_TYPE") : $this->server->getOr("HTTP_ACCEPT", '');
			if( ! preg_match('/(?:application|text)\/json(?:$|;| )/', $type) )
			{
				return false;
			}
		}

		$body = $this->body();
		if( strlen($body) && ( $body[0] === "{" || $body[0] === "[" ) )
		{
			$this->params_post = new Collection( Json::parse($body, true) );
			$this->body = '';
			$this->from_json = true;
		}

		return $this->from_json;
	}
public function readJson ( $ check_header = true , $ override = false ) { if ( ! is_null ( $ this -> from_json ) && ! $ override ) { return $ this -> from_json ; } // set false json reader $ this -> from_json = false ; if ( $ check_header ) { $ type = $ this -> server -> getIs ( "CONTENT_TYPE" ) ? $ this -> server -> get ( "CONTENT_TYPE" ) : $ this -> server -> getOr ( "HTTP_ACCEPT" , '' ) ; if ( ! preg_match ( '/(?:application|text)\/json(?:$|;| )/' , $ type ) ) { return false ; } } $ body = $ this -> body ( ) ; if ( strlen ( $ body ) && ( $ body [ 0 ] === "{" || $ body [ 0 ] === "[" ) ) { $ this -> params_post = new Collection ( Json :: parse ( $ body , true ) ) ; $ this -> body = '' ; $ this -> from_json = true ; } return $ this -> from_json ; }
Load json content from body data

@param bool $check_header
@param bool $override
@return bool
Load json content from body data