src/Response/LushResponse.php
public function isJson()
    {
        if (isset($this->isJson)) {
            return $this->isJson;
        }

        // check based on content header
        if (strpos($this->getHeader('content_type'), 'application/json') !== false) {
            $this->isJson = true;
        } else {
            // check based on content
            json_decode($this->content);
            $this->isJson = (json_last_error() == JSON_ERROR_NONE);
        }

        return $this->isJson;
    }
public function isJson()
    {
        if (isset($this->isJson)) {
            return $this->isJson;
        }

        // check based on content header
        if (strpos($this->getHeader('content_type'), 'application/json') !== false) {
            $this->isJson = true;
        } else {
            // check based on content
            json_decode($this->content);
            $this->isJson = (json_last_error() == JSON_ERROR_NONE);
        }

        return $this->isJson;
    }
public function isJson ( ) { if ( isset ( $ this -> isJson ) ) { return $ this -> isJson ; } // check based on content header if ( strpos ( $ this -> getHeader ( 'content_type' ) , 'application/json' ) !== false ) { $ this -> isJson = true ; } else { // check based on content json_decode ( $ this -> content ) ; $ this -> isJson = ( json_last_error ( ) == JSON_ERROR_NONE ) ; } return $ this -> isJson ; }
Check if content is json.

@return null
Check if content is json .