[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/ai-client/adapters/ -> class-wp-ai-client-http-client.php (summary)

WP AI Client: WP_AI_Client_HTTP_Client class

File Size: 226 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_AI_Client_HTTP_Client:: (7 methods):
  __construct()
  sendRequest()
  sendRequestWithOptions()
  prepare_wp_args()
  prepare_headers()
  prepare_body()
  create_psr_response()


Class: WP_AI_Client_HTTP_Client  - X-Ref

PSR-18 HTTP Client adapter using WordPress HTTP API.

Allows WordPress HTTP functions to be used as a PSR-18 compliant HTTP client
for the AI Client SDK.

__construct( ResponseFactoryInterface $response_factory, StreamFactoryInterface $stream_factory )   X-Ref
Constructor.

param: ResponseFactoryInterface $response_factory PSR-17 Response factory.
param: StreamFactoryInterface   $stream_factory   PSR-17 Stream factory.

sendRequest( RequestInterface $request )   X-Ref
Sends a PSR-7 request and returns a PSR-7 response.

return: ResponseInterface The PSR-7 response.
param: RequestInterface $request The PSR-7 request.

sendRequestWithOptions( RequestInterface $request, RequestOptions $options )   X-Ref
Sends a PSR-7 request with transport options and returns a PSR-7 response.

return: ResponseInterface The PSR-7 response.
param: RequestInterface $request The PSR-7 request.
param: RequestOptions   $options Transport options for the request.

prepare_wp_args( RequestInterface $request, ?RequestOptions $options = null )   X-Ref
Prepares WordPress HTTP API arguments from a PSR-7 request.

return: array<string, mixed> WordPress HTTP API arguments.
param: RequestInterface    $request The PSR-7 request.
param: RequestOptions|null $options Optional transport options for the request.

prepare_headers( RequestInterface $request )   X-Ref
Prepares headers for WordPress HTTP API.

return: array<string, string> Headers array for WordPress HTTP API.
param: RequestInterface $request The PSR-7 request.

prepare_body( RequestInterface $request )   X-Ref
Prepares request body for WordPress HTTP API.

return: string|null The request body.
param: RequestInterface $request The PSR-7 request.

create_psr_response( array $wp_response )   X-Ref
Creates a PSR-7 response from a WordPress HTTP response.

return: ResponseInterface PSR-7 response.
param: array<string, mixed> $wp_response WordPress HTTP API response array.



Generated : Sat Jun 13 09:38:55 2026 Cross-referenced by PHPXref