CurlHandler
in package
HTTP handler that uses cURL easy handles as a transport layer.
When using the CurlHandler, custom curl options can be specified as an associative array of curl option constants mapping to values in the curl key of the "client" key of the request.
Tags
Table of Contents
Constants
- KNOWN_CONSTRUCTOR_OPTIONS : mixed = ['handle_factory' => true, 'transport_sharing'...
Properties
- $factory : CurlFactoryInterface
- $shareHandleState : CurlShareHandleState|null
Methods
- __construct() : mixed
- Accepts an associative array of options:
- __invoke() : PromiseInterface
Constants
KNOWN_CONSTRUCTOR_OPTIONS
private
mixed
KNOWN_CONSTRUCTOR_OPTIONS
= ['handle_factory' => true, 'transport_sharing' => true]
Properties
$factory
private
CurlFactoryInterface
$factory
$shareHandleState
private
CurlShareHandleState|null
$shareHandleState
Methods
__construct()
Accepts an associative array of options:
public
__construct([CurlFactoryInterface, transport_sharing?: mixed} $options = [] ]) : mixed
- handle_factory: Optional curl factory used to create cURL handles.
- transport_sharing: Optional transport sharing mode.
Parameters
- $options : CurlFactoryInterface, transport_sharing?: mixed} = []
-
Array of options to use with the handler
__invoke()
public
__invoke(RequestInterface $request, array<string|int, mixed> $options) : PromiseInterface
Parameters
- $request : RequestInterface
- $options : array<string|int, mixed>