Request redirect middleware.

Apply this middleware like other middleware using
{@see \GuzzleHttp\Middleware::redirect()}.

CloneableInstantiable
Constants
public GuzzleHttp\RedirectMiddleware::HISTORY_HEADER = 'X-Guzzle-Redirect-History'
public GuzzleHttp\RedirectMiddleware::STATUS_HISTORY_HEADER = 'X-Guzzle-Redirect-Status-History'
Properties
public static $defaultSettings = ['max' => 5, 'protocols' => ['http', 'https'], 'strict' => false, 'referer' => false, 'track_redirects' => false]
Methods
public __construct(callable $nextHandler)
 
    public __invoke(Psr\Http\Message\RequestInterface $request, array $options)
     
    • return PromiseInterface
    public checkRedirect(Psr\Http\Message\RequestInterface $request, array $options, Psr\Http\Message\ResponseInterface $response)
     
    • return ResponseInterface|\PromiseInterface
    public modifyRequest(Psr\Http\Message\RequestInterface $request, array $options, Psr\Http\Message\ResponseInterface $response)
     
    • return RequestInterface
    Properties
    private $nextHandler
     
    • var callable
    Methods
    private guardMax(Psr\Http\Message\RequestInterface $request, array $options)
     

    Check for too many redirects

    • return void
    • throws TooManyRedirectsException Too many redirects.
    private redirectUri(Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, array $protocols)
     

    Set the appropriate URL on the request based on the location header

    • return UriInterface
    private withTracking(GuzzleHttp\Promise\PromiseInterface $promise, $uri, $statusCode)
     

    Enable tracking on promise.

    • return PromiseInterface
    Properties
    public static $defaultSettings = ['max' => 5, 'protocols' => ['http', 'https'], 'strict' => false, 'referer' => false, 'track_redirects' => false]
    © 2020 Bruce Wells
    Search Namespaces \ Classes
    ConfigurationNumbers (0-9.) only