public function parseResponse($response)
    {
        $response = explode("\r\n\r\n", $response);

        $this->body = array_pop($response);
        if (empty($this->body)) {
            $this->body = null;
        }

        $this->headers = new \OtherCode\Rest\Payloads\Headers(array_pop($response));


        if (isset($this->headers['Content-Type'])) {
            $content_type = explode(';', $this->headers['Content-Type']);
            $this->content_type = $content_type[0];
        }

        if (!isset($this->charset)) {
            $this->charset = substr($this->content_type, 5) === 'text/' ? 'iso-8859-1' : 'utf-8';
        }
    }
public function parseResponse($response)
    {
        $response = explode("\r\n\r\n", $response);

        $this->body = array_pop($response);
        if (empty($this->body)) {
            $this->body = null;
        }

        $this->headers = new \OtherCode\Rest\Payloads\Headers(array_pop($response));


        if (isset($this->headers['Content-Type'])) {
            $content_type = explode(';', $this->headers['Content-Type']);
            $this->content_type = $content_type[0];
        }

        if (!isset($this->charset)) {
            $this->charset = substr($this->content_type, 5) === 'text/' ? 'iso-8859-1' : 'utf-8';
        }
    }
public function parseResponse ( $ response ) { $ response = explode ( "\r\n\r\n" , $ response ) ; $ this -> body = array_pop ( $ response ) ; if ( empty ( $ this -> body ) ) { $ this -> body = null ; } $ this -> headers = new \ OtherCode \ Rest \ Payloads \ Headers ( array_pop ( $ response ) ) ; if ( isset ( $ this -> headers [ 'Content-Type' ] ) ) { $ content_type = explode ( ';' , $ this -> headers [ 'Content-Type' ] ) ; $ this -> content_type = $ content_type [ 0 ] ; } if ( ! isset ( $ this -> charset ) ) { $ this -> charset = substr ( $ this -> content_type , 5 ) === 'text/' ? 'iso-8859-1' : 'utf-8' ; } }
Parse the response
@param $response
Parse the response