Sets the maximum number of redirects to follow.
Description
Set to 0 to disable redirects, null for unspecified, or a positive integer to enable redirects with a maximum count.
Parameters
$maxRedirectsint|nullrequired- Maximum redirects to follow, or 0 to disable, or null for unspecified.
Source
public function setMaxRedirects(?int $maxRedirects): void
{
if ($maxRedirects !== null && $maxRedirects < 0) {
throw new InvalidArgumentException('Request option "maxRedirects" must be greater than or equal to 0.');
}
$this->maxRedirects = $maxRedirects;
}
Changelog
| Version | Description |
|---|---|
| 0.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.