|
Previous Page |
Solar_Http_Request_Adapter_Stream |
Next Page |
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
Local
- Overview
- Constants
- Properties
- Methods
- __construct()
- __destruct()
- __toString()
- _exception()
- _fetch()
- _parseCookie()
- _prepareContext()
- _prepareRequest()
- apiVersion()
- dump()
- fetch()
- fetchRaw()
- getContent()
- getOptions()
- locale()
- setBasicAuth()
- setCharset()
- setContent()
- setContentType()
- setCookie()
- setHeader()
- setMaxRedirects()
- setMethod()
- setProxy()
- setSslCafile()
- setSslCapath()
- setSslLocalCert()
- setSslPassphrase()
- setSslVerifyPeer()
- setTimeout()
- setUri()
- setUserAgent()
- setVersion()