REDIRECT_COUNT
REDIRECT_COUNT = 'redirect.count'
Plugin to implement HTTP redirects. Can redirect like a web browser or using strict RFC 2616 compliance
getSubscribedEvents() : array
Returns an array of event names this subscriber wants to listen to.
The array keys are event names and the value can be:
For instance:
The event names to listen to
cleanupRequest(\Guzzle\Common\Event $event)
Clean up the parameters of a request when it is cloned
\Guzzle\Common\Event | $event | Event emitted |
onRequestSent(\Guzzle\Common\Event $event)
Called when a request receives a redirect response
\Guzzle\Common\Event | $event | Event emitted |
getOriginalRequest(\Guzzle\Http\Message\RequestInterface $request) : \Guzzle\Http\Message\RequestInterface
Get the original request that initiated a series of redirects
\Guzzle\Http\Message\RequestInterface | $request | Request to get the original request from |
createRedirectRequest(\Guzzle\Http\Message\RequestInterface $request, integer $statusCode, string $location, \Guzzle\Http\Message\RequestInterface $original) : \Guzzle\Http\Message\RequestInterface
Create a redirect request for a specific request object
Takes into account strict RFC compliant redirection (e.g. redirect POST with POST) vs doing what most clients do (e.g. redirect POST with GET).
\Guzzle\Http\Message\RequestInterface | $request | Request being redirected |
integer | $statusCode | Status code of the redirect |
string | $location | Location header of the redirect |
\Guzzle\Http\Message\RequestInterface | $original | Original request |
If the body needs to be rewound but cannot
Returns a new redirect request
prepareRedirection(\Guzzle\Http\Message\RequestInterface $original, \Guzzle\Http\Message\RequestInterface $request, \Guzzle\Http\Message\Response $response) : \Guzzle\Http\Message\RequestInterface
Prepare the request for redirection and enforce the maximum number of allowed redirects per client
\Guzzle\Http\Message\RequestInterface | $original | Original request |
\Guzzle\Http\Message\RequestInterface | $request | Request to prepare and validate |
\Guzzle\Http\Message\Response | $response | The current response |
sendRedirectRequest(\Guzzle\Http\Message\RequestInterface $original, \Guzzle\Http\Message\RequestInterface $request, \Guzzle\Http\Message\Response $response)
Send a redirect request and handle any errors
\Guzzle\Http\Message\RequestInterface | $original | The originating request |
\Guzzle\Http\Message\RequestInterface | $request | The current request being redirected |
\Guzzle\Http\Message\Response | $response | The response of the current request |
throwTooManyRedirectsException(\Guzzle\Http\Message\RequestInterface $original, integer $max)
Throw a too many redirects exception for a request
\Guzzle\Http\Message\RequestInterface | $original | Request |
integer | $max | Max allowed redirects |
when too many redirects have been issued