WordPress\AiClient\Providers\Http\DTO

RequestOptions::setMaxRedirects │ public │ WP 0.2.0

Sets the maximum number of redirects to follow.

Set to 0 to disable redirects, null for unspecified, or a positive integer to enable redirects with a maximum count.

Метод класса: RequestOptions{}

Хуков нет.

Возвращает

void. Ничего (null).

Использование

$RequestOptions = new RequestOptions();
$RequestOptions->setMaxRedirects( ?int $maxRedirects ): void;
?int $maxRedirects(обязательный)
.

Список изменений

С версии 0.2.0 Введена.

Код RequestOptions::setMaxRedirects() WP 7.1.2

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;
}