\Guzzle\Http\MessageMessageInterface

Request and response message interface

Summary

Methods
Constants
getParams()
addHeader()
addHeaders()
getHeader()
getHeaders()
hasHeader()
removeHeader()
setHeader()
setHeaders()
getHeaderLines()
getRawHeaders()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getParams()

getParams() : \Guzzle\Common\Collection

Get application and plugin specific parameters set on the message.

Returns

\Guzzle\Common\Collection

addHeader()

addHeader(string  $header, string  $value) : self

Add a header to an existing collection of headers.

Parameters

string $header

Header name to add

string $value

Value of the header

Returns

self

addHeaders()

addHeaders(array  $headers) : self

Add and merge in an array of HTTP headers.

Parameters

array $headers

Associative array of header data.

Returns

self

getHeader()

getHeader(string  $header) : \Guzzle\Http\Message\Header|null

Retrieve an HTTP header by name. Performs a case-insensitive search of all headers.

Parameters

string $header

Header to retrieve.

Returns

\Guzzle\Http\Message\Header|null

hasHeader()

hasHeader(string  $header) : boolean

Check if the specified header is present.

Parameters

string $header

The header to check.

Returns

boolean

removeHeader()

removeHeader(string  $header) : self

Remove a specific HTTP header.

Parameters

string $header

HTTP header to remove.

Returns

self

setHeader()

setHeader(string  $header, mixed  $value) : self

Set an HTTP header and overwrite any existing value for the header

Parameters

string $header

Name of the header to set.

mixed $value

Value to set.

Returns

self

setHeaders()

setHeaders(array  $headers) : self

Overwrite all HTTP headers with the supplied array of headers

Parameters

array $headers

Associative array of header data.

Returns

self

getHeaderLines()

getHeaderLines() : array

Get an array of message header lines (e.g. ["Host: example.com", .

..])

Returns

array

getRawHeaders()

getRawHeaders() : string

Get the raw message headers as a string

Returns

string