- Summary
Describes the redirect behavior of a request- Types
-
- bool
- array
- Default
- Constant
Set to
false
to disable redirects.
Set to true
(the default setting) to enable normal redirects with a maximumnumber of 5 redirects.
strict: (bool, default=false) Set to true to use strict redirects.Strict RFC compliant redirects mean that POST redirect requests are sent asPOST requests vs. doing what most browsers do which is redirect POST requestswith GET requests.
referer: (bool, default=false) Set to true to enable adding the Refererheader when redirecting.
track_redirects: (bool) When set to , each redirected URI and statuscode encountered will be tracked in the
X-Guzzle-Redirect-History
andX-Guzzle-Redirect-Status-History
headers respectively. All URIs andstatus codes will be stored in the order which the redirects were encountered.
Note: When tracking redirects the header willexclude the initial request's URI and the X-Guzzle-Redirect-Status-History
header will exclude the final status code.
Warning
This option only has an effect if your handler has theGuzzleHttp\Middleware::redirect
middleware. This middleware is addedby default when a client is created with no handler, and is added bydefault when creating a handler with .