WordPress\AiClient\Providers\Http\Abstracts
AbstractClientDiscoveryStrategy::createClient
Creates an instance of the HTTP client.
Subclasses must implement this method to return their specific PSR-18 HTTP client instance. The provided Psr17Factory implements all PSR-17 interfaces (RequestFactory, ResponseFactory, StreamFactory, etc.) and can be used to satisfy client constructor dependencies.
Method of the class: AbstractClientDiscoveryStrategy{}
No Hooks.
Returns
ClientInterface. The PSR-18 HTTP client.
Usage
$result = AbstractClientDiscoveryStrategy::createClient( $psr17Factory ): ClientInterface;
- $psr17Factory(Psr17Factory) (required)
- The PSR-17 factory for creating HTTP messages.
Changelog
| Since 1.1.0 | Introduced. |
AbstractClientDiscoveryStrategy::createClient() AbstractClientDiscoveryStrategy::createClient code WP 7.0
abstract protected static function createClient(Psr17Factory $psr17Factory): ClientInterface;