HttpTransporterFactory::createTransporter(): WordPressAiClientProvidersHttpContractsHttpTransporterInterface

In this article

Creates an HTTP transporter.

Description

Uses HTTPlug Discovery to automatically find PSR-18 client and PSR-17 factories if not provided.

Return

WordPressAiClientProvidersHttpContractsHttpTransporterInterface The HTTP transporter.

Source

public static function createTransporter(): HttpTransporterInterface
{
    return new \WordPress\AiClient\Providers\Http\HttpTransporter(Psr18ClientDiscovery::find(), Psr17FactoryDiscovery::findRequestFactory(), Psr17FactoryDiscovery::findStreamFactory());
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

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