WordPress\AiClient\Providers\Http
HttpTransporter::sendWithGuzzle
Sends a request using a Guzzle-compatible client.
Метод класса: HttpTransporter{}
Хуков нет.
Возвращает
ResponseInterface. The PSR-7 response received.
Использование
// private - только в коде основоного (родительского) класса $result = $this->sendWithGuzzle( $request, $options ): ResponseInterface;
- $request(RequestInterface) (обязательный)
- The PSR-7 request to send.
- $options(RequestOptions) (обязательный)
- The request options.
Список изменений
| С версии 0.2.0 | Введена. |
Код HttpTransporter::sendWithGuzzle() HttpTransporter::sendWithGuzzle WP 7.1.4
private function sendWithGuzzle(RequestInterface $request, RequestOptions $options): ResponseInterface
{
$guzzleOptions = $this->buildGuzzleOptions($options);
/** @var callable $callable */
$callable = [$this->client, 'send'];
/** @var ResponseInterface $response */
$response = $callable($request, $guzzleOptions);
return $response;
}