Previous Page
setCookie()

Solar_Http_Request_Adapter_Stream
setHeader()

Next Page
setMaxRedirects()

setHeader()

public Solar_Http_Adapter setHeader ( string $key, string $val, bool $replace default true )

Sets a header value in $this->_headers for sending at fetch() time.

Inherited from Solar_Http_Request_Adapter.

Parameters

  • (string) $key: The header label, such as "X-Foo-Bar".
  • (string) $val: The value for the header. When null or false, deletes the header.
  • (bool) $replace: This header value should replace any previous values of the same key. When false, the same header key is sent multiple times with the different values.

Returns

  • (Solar_Http_Adapter) This adapter object.

Description

Sets a header value in $this->_headers for sending at fetch() time.

This method will not set certain headers; use the provided methods instead.

Header Method
Authorization setBasicAuth()
Content-Type setContentType(), setCharset()
Cookie setCookie()
HTTP setVersion()
User-Agent setUserAgent()

See Also