@
trigger_error('Configure the "curl.cainfo", "openssl.cafile" or "openssl.capath" php.ini setting to enable the CurlHttpClient', \E_USER_WARNING
);
} if ($amp) { return new AmpHttpClient($defaultOptions, null,
$maxHostConnections,
$maxPendingPushes);
} @
trigger_error((\
extension_loaded('curl'
) ? 'Upgrade' : 'Install'
).' the curl extension or run "composer require amphp/http-client:^4.2.1" to perform async HTTP operations, including full HTTP/2 support', \E_USER_NOTICE
);
return new NativeHttpClient($defaultOptions,
$maxHostConnections);
} /**
* Creates a client that adds options (e.g. authentication headers) only when the request URL matches the provided base URI.
*/
public static function createForBaseUri(string
$baseUri, array
$defaultOptions =
[], int
$maxHostConnections = 6, int
$maxPendingPushes = 50
): HttpClientInterface
{ $client = self::
create([],
$maxHostConnections,
$maxPendingPushes);
return ScopingHttpClient::
forBaseUri($client,
$baseUri,
$defaultOptions);
}}