protected function getRequestHeaders(array $headers)
    {
        $requestHeaders = '';

        foreach ($this->headers as $name => $value) {
            if (!isset($headers[$name])) {
                $requestHeaders .= "$name: $value\r\n";
            }
        }

        foreach ($headers as $name => $value) {
            if (is_numeric($name)) {
                throw new RuntimeException("Invalid HTTP header name $name");
            }

            $requestHeaders .= "$name: $value\r\n";
        }

        return $requestHeaders;
    }
protected function getRequestHeaders(array $headers)
    {
        $requestHeaders = '';

        foreach ($this->headers as $name => $value) {
            if (!isset($headers[$name])) {
                $requestHeaders .= "$name: $value\r\n";
            }
        }

        foreach ($headers as $name => $value) {
            if (is_numeric($name)) {
                throw new RuntimeException("Invalid HTTP header name $name");
            }

            $requestHeaders .= "$name: $value\r\n";
        }

        return $requestHeaders;
    }
protected function getRequestHeaders ( array $ headers ) { $ requestHeaders = '' ; foreach ( $ this -> headers as $ name => $ value ) { if ( ! isset ( $ headers [ $ name ] ) ) { $ requestHeaders .= "$name: $value\r\n" ; } } foreach ( $ headers as $ name => $ value ) { if ( is_numeric ( $ name ) ) { throw new RuntimeException ( "Invalid HTTP header name $name" ) ; } $ requestHeaders .= "$name: $value\r\n" ; } return $ requestHeaders ; }
Get formatted request headers.

Merged with the default values.

@param array $headers

@return string
Get formatted request headers .