public function setHeaders($rawHeaders){

        $rawHeaders = str_replace("\r\n", "\n", $rawHeaders);
        $response_headers_rows = explode("\n", trim($rawHeaders));
        foreach ($response_headers_rows as $line) {
            if(strpos($line, ': ') == false){
                continue;
            }else {
                list($key, $value) = explode(': ', $line);
                $this->headers[$key] = $value;
                //set response content type
                $this->setContentType($key, $value);
                $this->setIntuitTid($key, $value);
            }
        }

   }
public function setHeaders($rawHeaders){

        $rawHeaders = str_replace("\r\n", "\n", $rawHeaders);
        $response_headers_rows = explode("\n", trim($rawHeaders));
        foreach ($response_headers_rows as $line) {
            if(strpos($line, ': ') == false){
                continue;
            }else {
                list($key, $value) = explode(': ', $line);
                $this->headers[$key] = $value;
                //set response content type
                $this->setContentType($key, $value);
                $this->setIntuitTid($key, $value);
            }
        }

   }
public function setHeaders ( $ rawHeaders ) { $ rawHeaders = str_replace ( "\r\n" , "\n" , $ rawHeaders ) ; $ response_headers_rows = explode ( "\n" , trim ( $ rawHeaders ) ) ; foreach ( $ response_headers_rows as $ line ) { if ( strpos ( $ line , ': ' ) == false ) { continue ; } else { list ( $ key , $ value ) = explode ( ': ' , $ line ) ; $ this -> headers [ $ key ] = $ value ; //set response content type $ this -> setContentType ( $ key , $ value ) ; $ this -> setIntuitTid ( $ key , $ value ) ; } } }
Parse the raw Http Response Header to associated array to be consumered.
It will also store the Content-Type of the response.
@param string | Array rawHeaders
Parse the raw Http Response Header to associated array to be consumered . It will also store the Content - Type of the response .