src/MultiCurlManager.php
protected function parseResponseHeaders(Response $response, string $headerString)
    {
        foreach (array_filter(explode("\r\n\r\n", $headerString)) as $responseHeader) {
            $header = new Header();
            foreach (explode("\r\n", $responseHeader) as $headerLine) {
                $parts = explode(':', $headerLine, 2);
                if (count($parts) === 2) {
                    $header->set(trim($parts[0]), trim($parts[1]));
                }
            }
            $response->addHeader($header);
        }
        return $this;
    }
protected function parseResponseHeaders(Response $response, string $headerString)
    {
        foreach (array_filter(explode("\r\n\r\n", $headerString)) as $responseHeader) {
            $header = new Header();
            foreach (explode("\r\n", $responseHeader) as $headerLine) {
                $parts = explode(':', $headerLine, 2);
                if (count($parts) === 2) {
                    $header->set(trim($parts[0]), trim($parts[1]));
                }
            }
            $response->addHeader($header);
        }
        return $this;
    }
protected function parseResponseHeaders ( Response $ response , string $ headerString ) { foreach ( array_filter ( explode ( "\r\n\r\n" , $ headerString ) ) as $ responseHeader ) { $ header = new Header ( ) ; foreach ( explode ( "\r\n" , $ responseHeader ) as $ headerLine ) { $ parts = explode ( ':' , $ headerLine , 2 ) ; if ( count ( $ parts ) === 2 ) { $ header -> set ( trim ( $ parts [ 0 ] ) , trim ( $ parts [ 1 ] ) ) ; } } $ response -> addHeader ( $ header ) ; } return $ this ; }
Parses the header string into the response.
@param Response $response
@param string $headerString
@return $this
Parses the header string into the response .