Interface MessageInterface
Request and response message interface
Direct known implementers
Guzzle\Http\Message\AbstractMessage
,
Guzzle\Http\Message\RequestInterface
Indirect known implementers
Guzzle\Http\Message\EntityEnclosingRequest
,
Guzzle\Http\Message\EntityEnclosingRequestInterface
,
Guzzle\Http\Message\Request
,
Guzzle\Http\Message\Response
Methods summary
-
public
getParams ( )
Get application and plugin specific parameters set on the message.
-
public
addHeader ( string $header, string $value )
Add a header to an existing collection of headers.
-
public
addHeaders ( array $headers )
Add and merge in an array of HTTP headers.
-
public
getHeader ( string $header )
Retrieve an HTTP header by name. Performs a case-insensitive search of all headers.
-
public
getHeaders ( )
Get all headers as a collection
-
public
hasHeader ( string $header )
Check if the specified header is present.
-
public
removeHeader ( string $header )
Remove a specific HTTP header.
-
public
setHeader ( string $header, mixed $value )
Set an HTTP header and overwrite any existing value for the header
-
public
setHeaders ( array $headers )
Overwrite all HTTP headers with the supplied array of headers
-
public
getHeaderLines ( )
Get an array of message header lines (e.g. ["Host: example.com", ...])
-
public
getRawHeaders ( )
Get the raw message headers as a string
Methods detail
Add a header to an existing collection of headers.
Parameters
- $header
string
$header Header name to add- $value
string
$value Value of the header
Returns
Add and merge in an array of HTTP headers.
Parameters
- $headers
array
$headers Associative array of header data.
Returns
Retrieve an HTTP header by name. Performs a case-insensitive search of all headers.
Parameters
- $header
string
$header Header to retrieve.
Returns
Check if the specified header is present.
Parameters
- $header
string
$header The header to check.
Returns
boolean
Remove a specific HTTP header.
Parameters
- $header
string
$header HTTP header to remove.
Returns
Set an HTTP header and overwrite any existing value for the header
Parameters
- $header
string
$header Name of the header to set.- $value
mixed
$value Value to set.
Returns
Overwrite all HTTP headers with the supplied array of headers
Parameters
- $headers
array
$headers Associative array of header data.
Returns
Get an array of message header lines (e.g. ["Host: example.com", ...])
Returns
array
Get the raw message headers as a string
Returns
string