HttpTransporter::sendWithGuzzle( WordPressAiClientDependenciesPsrHttpMessageRequestInterface $request, WordPressAiClientProvidersHttpDTORequestOptions $options ): WordPressAiClientDependenciesPsrHttpMessageResponseInterface

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only by core. It is listed here for completeness.

Sends a request using a Guzzle-compatible client.

Parameters

$requestWordPressAiClientDependenciesPsrHttpMessageRequestInterfacerequired
The PSR-7 request to send.
$optionsWordPressAiClientProvidersHttpDTORequestOptionsrequired
The request options.

Return

WordPressAiClientDependenciesPsrHttpMessageResponseInterface The PSR-7 response received.

Source

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

Changelog

VersionDescription
0.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.