Class AbstractMessage
Abstract HTTP request/response message
- Guzzle\Http\Message\AbstractMessage implements Guzzle\Http\Message\MessageInterface
Direct known subclasses
Indirect known subclasses
Methods summary
-
public__construct ( ) -
publicsetHeaderFactory ( Guzzle\Http\Message\Header\HeaderFactoryInterface $factory )Set the header factory to use to create headers
-
publicgetParams ( )Get application and plugin specific parameters set on the message.
-
publicaddHeader ( string $header, string $value )Add a header to an existing collection of headers.
-
publicaddHeaders ( array $headers )Add and merge in an array of HTTP headers.
-
publicgetHeader ( string $header )Retrieve an HTTP header by name. Performs a case-insensitive search of all headers.
-
publicgetHeaders ( )Get all headers as a collection
-
publicgetHeaderLines ( )Get an array of message header lines (e.g. ["Host: example.com", ...])
-
publicsetHeader ( string $header, mixed $value )Set an HTTP header and overwrite any existing value for the header
-
publicsetHeaders ( array $headers )Overwrite all HTTP headers with the supplied array of headers
-
publichasHeader ( string $header )Check if the specified header is present.
-
publicremoveHeader ( string $header )Remove a specific HTTP header.
Methods detail
public
Guzzle\Http\Message\AbstractMessage
setHeaderFactory( Guzzle\Http\Message\Header\HeaderFactoryInterface $factory )
Set the header factory to use to create headers
Parameters
- $factory
Guzzle\Http\Message\Header\HeaderFactoryInterface
$factory
Returns
Get application and plugin specific parameters set on the message.
Returns
Implementation of
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
Implementation of
Add and merge in an array of HTTP headers.
Parameters
- $headers
array
$headers Associative array of header data.
Returns
Implementation of
Retrieve an HTTP header by name. Performs a case-insensitive search of all headers.
Parameters
- $header
string
$header Header to retrieve.
Returns
Implementation of
Get all headers as a collection
Returns
Implementation of
Get an array of message header lines (e.g. ["Host: example.com", ...])
Returns
arrayImplementation of
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
Implementation of
Overwrite all HTTP headers with the supplied array of headers
Parameters
- $headers
array
$headers Associative array of header data.
Returns
Implementation of
Check if the specified header is present.
Parameters
- $header
string
$header The header to check.
Returns
booleanImplementation of
Remove a specific HTTP header.
Parameters
- $header
string
$header HTTP header to remove.
Returns
Implementation of
Methods inherited from Guzzle\Http\Message\MessageInterface
Magic methods summary
Properties summary
protected
array
|
$headers |
#
HTTP header collection |
protected
|
$headerFactory |
#
$headerFactory |
protected
|
$params |
#
Custom message parameters that are extendable by plugins |
protected
string
|
$protocol |
#
Message protocol |
protected
string
|
$protocolVersion |
#
HTTP protocol version of the message |