Skip to content

TransportFactory

Chooses the default underlying PSR-18 transport: Guzzle if it is installed (its GuzzleHttp\Client already implements PSR-18 ClientInterface, so it is used directly — no adapter needed), otherwise the zero-dependency CurlTransport.

Callers can override per named client via HttpClientConfig::$transport or globally via HttpClientFactory::setDefaultTransportFactory().

final class TransportFactory

SourceHttp/Client/TransportFactory.php
MethodDescription
default(): ClientInterface

public static function default(): ClientInterface

Returns ClientInterface