$eventDispatcher
$eventDispatcher : \Symfony\Component\EventDispatcher\EventDispatcherInterface
HTTP request that sends an entity-body in the request message (POST, PUT, PATCH, DELETE)
$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
$headerFactory : \Guzzle\Http\Message\Header\HeaderFactoryInterface
$params : \Guzzle\Common\Collection
$body : \Guzzle\Http\EntityBodyInterface
$postFields : \Guzzle\Http\QueryString
__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 |
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
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
send() : \Guzzle\Http\Message\Response
Send the request
getResponse() : \Guzzle\Http\Message\Response|null
Get the previously received {@see Response} or NULL if the request has not been sent
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 |
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)) |
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. |
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
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 |
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.
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.
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 |
---|
setHeaderFactory(\Guzzle\Http\Message\Header\HeaderFactoryInterface $factory) : self
Set the header factory to use to create headers
\Guzzle\Http\Message\Header\HeaderFactoryInterface | $factory |
None found |
getParams() : \Guzzle\Common\Collection
Get application and plugin specific parameters set on the message.
None found |
addHeader(string $header, string $value) : self
Add a header to an existing collection of headers.
string | $header | Header name to add |
string | $value | Value of the header |
None found |
addHeaders(array $headers) : self
Add and merge in an array of HTTP headers.
array | $headers | Associative array of header data. |
None found |
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. |
None found |
getHeaders() : \Guzzle\Http\Message\Header\HeaderCollection
Get all headers as a collection
None found |
getHeaderLines() : array
Get an array of message header lines (e.g. ["Host: example.com", .
..])
None found |
setHeader(string $header, mixed $value) : self
Set an HTTP header and overwrite any existing value for the header
string | $header | Name of the header to set. |
mixed | $value | Value to set. |
None found |
setHeaders(array $headers) : self
Overwrite all HTTP headers with the supplied array of headers
array | $headers | Associative array of header data. |
None found |
hasHeader(string $header) : boolean
Check if the specified header is present.
string | $header | The header to check. |
None found |
removeHeader(string $header) : self
Remove a specific HTTP header.
string | $header | HTTP header to remove. |
None found |
codeCoverageIgnore |
---|
setTokenizedHeader( $header, $data, $token = ';')
$header | ||
$data | ||
$token |
codeCoverageIgnore |
---|
codeCoverageIgnore |
---|
codeCoverageIgnore |
---|
addCacheControlDirective( $directive, $value = true)
$directive | ||
$value |
codeCoverageIgnore |
---|
codeCoverageIgnore |
---|
setBody(string|resource|\Guzzle\Http\EntityBodyInterface $body, string $contentType = null) : self
Set the body of the request
string|resource|\Guzzle\Http\EntityBodyInterface | $body | Body to use in the entity body of the request |
string | $contentType | Content-Type to set. Leave null to use an existing Content-Type or to guess the Content-Type |
None found |
getBody() : \Guzzle\Http\EntityBodyInterface|null
Get the body of the request if set
None found |
setExpectHeaderCutoff(integer|boolean $size) : self
Set the size that the entity body of the request must exceed before adding the Expect: 100-Continue header.
integer|boolean | $size | Cutoff in bytes. Set to false to never send the expect header (even with non-seekable data) |
None found |
configureRedirects(boolean $strict = false, integer $maxRedirects = 5) : self
Configure how redirects are handled for the request
boolean | $strict | Set to true to follow strict RFC compliance when redirecting POST requests. Most browsers with follow a 301-302 redirect for a POST request with a GET request. This is the default behavior of Guzzle. Enable strict redirects to redirect these responses with a POST rather than a GET request. |
integer | $maxRedirects | Specify the maximum number of allowed redirects. Set to 0 to disable redirects. |
None found |
getPostField(string $field) : mixed|null
Get a POST field from the request
string | $field | Field to retrieve |
None found |
getPostFields() : \Guzzle\Http\QueryString
Get the post fields that will be used in the request
None found |
setPostField(string $key, string $value) : self
Set a POST field value
string | $key | Key to set |
string | $value | Value to set |
None found |
addPostFields(\Guzzle\Http\QueryString|array $fields) : self
Add POST fields to use in the request
\Guzzle\Http\QueryString|array | $fields | POST fields |
None found |
removePostField(string $field) : self
Remove a POST field or file by name
string | $field | Name of the POST field or file to remove |
None found |
getPostFiles() : array
Returns an associative array of POST field names to PostFileInterface objects
None found |
getPostFile(string $fieldName) : array|null
Get a POST file from the request
string | $fieldName | POST fields to retrieve |
Returns an array wrapping an array of PostFileInterface objects
None found |
removePostFile(string $fieldName) : self
Remove a POST file from the request
string | $fieldName | POST file field name to remove |
None found |
addPostFile(string $field, string $filename = null, string $contentType = null, string $postname = null) : self
Add a POST file to the upload
string | $field | POST field to use (e.g. file). Used to reference content from the server. |
string | $filename | Full path to the file. Do not include the @ symbol. |
string | $contentType | Optional Content-Type to add to the Content-Disposition. Default behavior is to guess. Set to false to not specify. |
string | $postname | The name of the file, when posted. (e.g. rename the file) |
None found |
addPostFiles(array $files) : self
Add POST files to use in the upload
array | $files | An array of POST fields => filenames where filename can be a string or PostFileInterface |
None found |
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 |
processPostFields()
Determine what type of request should be sent based on post fields
None found |