$headers
$headers : array
HTTP request class to send requests
$headerFactory : \Guzzle\Http\Message\Header\HeaderFactoryInterface
$params : \Guzzle\Common\Collection
$eventDispatcher : \Symfony\Component\EventDispatcher\EventDispatcherInterface
$url : \Guzzle\Http\Url
$client : \Guzzle\Http\ClientInterface
$response : \Guzzle\Http\Message\Response
$responseBody : \Guzzle\Http\EntityBodyInterface
$curlOptions : \Guzzle\Common\Collection
__construct(string $method, string|\Guzzle\Http\Url $url, array|\Guzzle\Common\Collection $headers = array())
string | $method | HTTP method |
string|\Guzzle\Http\Url | $url | HTTP URL to connect to. The URI scheme, host header, and URI are parsed from the full URL. If query string parameters are present they will be parsed as well. |
array|\Guzzle\Common\Collection | $headers | HTTP headers |
setHeaderFactory(\Guzzle\Http\Message\Header\HeaderFactoryInterface $factory) : self
Set the header factory to use to create headers
\Guzzle\Http\Message\Header\HeaderFactoryInterface | $factory |
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
setTokenizedHeader( $header, $data, $token = ';')
$header | ||
$data | ||
$token |
codeCoverageIgnore |
---|
codeCoverageIgnore |
---|
codeCoverageIgnore |
---|
addCacheControlDirective( $directive, $value = true)
$directive | ||
$value |
codeCoverageIgnore |
---|
codeCoverageIgnore |
---|
None found |
None found |
None found |
onRequestError(\Guzzle\Common\Event $event)
Default method that will throw exceptions if an unsuccessful response is received.
\Guzzle\Common\Event | $event | Received |
if the response is not successful
None found |
setClient(\Guzzle\Http\ClientInterface $client) : self
Set the client used to transport the request
\Guzzle\Http\ClientInterface | $client |
None found |
getClient() : \Guzzle\Http\ClientInterface
Get the client used to transport the request
$client
None found |
None found |
None found |
send() : \Guzzle\Http\Message\Response
Send the request
None found |
getResponse() : \Guzzle\Http\Message\Response|null
Get the previously received {@see Response} or NULL if the request has not been sent
None found |
getQuery( $asString = false) : \Guzzle\Http\QueryString
Get the collection of key value pairs that will be used as the query string in the request
$asString |
None found |
None found |
getScheme() : string
Get the URI scheme of the request (http, https, ftp, etc)
None found |
setScheme(string $scheme) : self
Set the URI scheme of the request (http, https, ftp, etc)
string | $scheme | Scheme to set |
None found |
None found |
setHost(string $host) : self
Set the host of the request. Including a port in the host will modify the port of the request.
string | $host | Host to set (e.g. www.yahoo.com, www.yahoo.com:80) |
None found |
getProtocolVersion() : string
Get the HTTP protocol version of the request
None found |
setProtocolVersion(string $protocol) : self
Set the HTTP protocol version of the request (e.g. 1.1 or 1.0)
string | $protocol | HTTP protocol version to use with the request |
None found |
None found |
setPath(string|array $path) : self
Set the path of the request (e.g. '/', '/index.html')
string|array | $path | Path to set or array of segments to implode |
None found |
getPort() : integer|null
Get the port that the request will be sent on if it has been set
None found |
setPort(integer $port) : self
Set the port that the request will be sent on
integer | $port | Port number to set |
None found |
getUsername() : string|null
Get the username to pass in the URL if set
None found |
getPassword() : string|null
Get the password to pass in the URL if set
None found |
setAuth(string|boolean $user, string $password = '', string $scheme = CURLAUTH_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)) |
None found |
getResource() : string
Get the resource part of the the request, including the path, query string, and fragment
None found |
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. |
None found |
getState() : string
Get the state of the request. One of 'complete', 'transfer', 'new', 'error'
None found |
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)
None found |
getCurlOptions() : \Guzzle\Common\Collection
Get the cURL options that will be applied when the cURL handle is created
None found |
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 |
None found |
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.
None found |
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. |
None found |
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.
None found |
isResponseBodyRepeatable() : boolean
Determine if the response body is repeatable (readable + seekable)
codeCoverageIgnore |
---|
None found |
getCookie(string $name) : null|string
Get a cookie value by name
string | $name | Cookie to retrieve |
None found |
addCookie(string $name, string $value) : self
Add a Cookie value by name to the Cookie header
string | $name | Name of the cookie to add |
string | $value | Value to set |
None found |
removeCookie(string $name) : self
Remove a specific cookie value by name
string | $name | Cookie to remove by name |
None found |
setEventDispatcher(\Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher)
\Symfony\Component\EventDispatcher\EventDispatcherInterface | $eventDispatcher |
None found |
None found |
None found |
addSubscriber(\Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber)
\Symfony\Component\EventDispatcher\EventSubscriberInterface | $subscriber |
None found |
codeCoverageIgnore |
---|
codeCoverageIgnore |
---|
codeCoverageIgnore |
---|
getEventArray() : array
Get an array containing the request and response for event notifications
None found |
processResponse(array $context = array())
Process a received response
array | $context | Contextual information |
on unsuccessful responses
None found |