STATE_NEW
STATE_NEW = 'new'
Generic HTTP request interface
getParams() : \Guzzle\Common\Collection
Get application and plugin specific parameters set on the message.
getHeader(string $header) : \Guzzle\Http\Message\Header|null
Retrieve an HTTP header by name. Performs a case-insensitive search of all headers.
string | $header | Header to retrieve. |
getHeaders() : \Guzzle\Http\Message\Header\HeaderCollection
Get all headers as a collection
setEventDispatcher(\Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher) : self
Set the EventDispatcher of the request
\Symfony\Component\EventDispatcher\EventDispatcherInterface | $eventDispatcher |
getEventDispatcher() : \Symfony\Component\EventDispatcher\EventDispatcherInterface
Get the EventDispatcher of the request
dispatch(string $eventName, array $context = array()) : \Guzzle\Common\Event
Helper to dispatch Guzzle events and set the event name on the event
string | $eventName | Name of the event to dispatch |
array | $context | Context of the event |
Returns the created event object
addSubscriber(\Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber) : self
Add an event subscriber to the dispatcher
\Symfony\Component\EventDispatcher\EventSubscriberInterface | $subscriber | Event subscriber |
send() : \Guzzle\Http\Message\Response
Send the request
on a request error
setClient(\Guzzle\Http\ClientInterface $client) : self
Set the client used to transport the request
\Guzzle\Http\ClientInterface | $client |
getClient() : \Guzzle\Http\ClientInterface
Get the client used to transport the request
$client
getUrl(boolean $asObject = false) : string|\Guzzle\Http\Url
Get the full URL of the request (e.g. 'http://www.guzzle-project.com/')
boolean | $asObject | Set to TRUE to retrieve the URL as a clone of the URL object owned by the request. |
getQuery() : \Guzzle\Http\QueryString
Get the collection of key value pairs that will be used as the query string in the request
setAuth(string|boolean $user, string $password = '', string $scheme = 'Basic') : self
Set HTTP authorization parameters
string|boolean | $user | User name or false disable authentication |
string | $password | Password |
string | $scheme | Authentication scheme ('Basic', 'Digest', or a CURLAUTH_* constant (deprecated)) |
getResponse() : \Guzzle\Http\Message\Response|null
Get the previously received {@see Response} or NULL if the request has not been sent
setResponse(\Guzzle\Http\Message\Response $response, boolean $queued = false) : self
Manually set a response for the request.
This method is useful for specifying a mock response for the request or setting the response using a cache. Manually setting a response will bypass the actual sending of a request.
\Guzzle\Http\Message\Response | $response | Response object to set |
boolean | $queued | Set to TRUE to keep the request in a state of not having been sent, but queue the response for send() |
Returns a reference to the object.
startResponse(\Guzzle\Http\Message\Response $response) : self
The start of a response has been received for a request and the request is still in progress
\Guzzle\Http\Message\Response | $response | Response that has been received so far |
setResponseBody(\Guzzle\Http\EntityBodyInterface|string|resource $body) : \Guzzle\Http\Message\Request
Set the EntityBody that will hold a successful response message's entity body.
This method should be invoked when you need to send the response's entity body somewhere other than the normal php://temp buffer. For example, you can send the entity body to a socket, file, or some other custom stream.
\Guzzle\Http\EntityBodyInterface|string|resource | $body | Response body object. Pass a string to attempt to store the response body in a local file. |
getResponseBody() : \Guzzle\Http\EntityBodyInterface
Get the EntityBody that will hold the resulting response message's entity body. This response body will only be used for successful responses. Intermediate responses (e.g. redirects) will not use the targeted response body.
setState(string $state, array $context = array()) : string
Set the state of the request
string | $state | State of the request ('complete', 'transfer', 'new', 'error') |
array | $context | Contextual information about the state change |
Returns the current state of the request (which may have changed due to events being fired)
getCurlOptions() : \Guzzle\Common\Collection
Get the cURL options that will be applied when the cURL handle is created