Constants

CURL_VERSION_STR

CURL_VERSION_STR = 'curl_version'

LOW_CURL_VERSION_NUMBER

LOW_CURL_VERSION_NUMBER = '7.21.2'

Properties

$handles

$handles : resource[]|\CurlHandle[]

Type

CurlHandle[]

$maxHandles

$maxHandles : int

Type

int — Total number of idle handles to keep in cache

Methods

__construct()

__construct(int  $maxHandles) : mixed

Parameters

int $maxHandles

Maximum number of idle handles.

Returns

mixed —

create()

create(\Psr\Http\Message\RequestInterface  $request, array  $options) : \GuzzleHttp\Handler\EasyHandle

Creates a cURL handle resource.

Parameters

\Psr\Http\Message\RequestInterface $request

Request

array $options

Transfer options

Returns

\GuzzleHttp\Handler\EasyHandle —

release()

release(\GuzzleHttp\Handler\EasyHandle  $easy) : void

Release an easy handle, allowing it to be reused or closed.

This function must call unset on the easy handle's "handle" property.

Parameters

\GuzzleHttp\Handler\EasyHandle $easy

finish()

finish(callable  $handler, \GuzzleHttp\Handler\EasyHandle  $easy, \GuzzleHttp\Handler\CurlFactoryInterface  $factory) : \GuzzleHttp\Promise\PromiseInterface

Completes a cURL transaction, either returning a response promise or a rejected promise.

Parameters

callable $handler
\GuzzleHttp\Handler\EasyHandle $easy
\GuzzleHttp\Handler\CurlFactoryInterface $factory

Dictates how the handle is released

Returns

\GuzzleHttp\Promise\PromiseInterface —

invokeStats()

invokeStats(\GuzzleHttp\Handler\EasyHandle  $easy) : void

Parameters

\GuzzleHttp\Handler\EasyHandle $easy

finishError()

finishError(callable  $handler, \GuzzleHttp\Handler\EasyHandle  $easy, \GuzzleHttp\Handler\CurlFactoryInterface  $factory) : \GuzzleHttp\Promise\PromiseInterface

Parameters

callable $handler
\GuzzleHttp\Handler\EasyHandle $easy
\GuzzleHttp\Handler\CurlFactoryInterface $factory

Returns

\GuzzleHttp\Promise\PromiseInterface —

createRejection()

createRejection(\GuzzleHttp\Handler\EasyHandle  $easy, array  $ctx) : \GuzzleHttp\Promise\PromiseInterface

Parameters

\GuzzleHttp\Handler\EasyHandle $easy
array $ctx

Returns

\GuzzleHttp\Promise\PromiseInterface —

getDefaultConf()

getDefaultConf(\GuzzleHttp\Handler\EasyHandle  $easy) : array<int|string,mixed>

Parameters

\GuzzleHttp\Handler\EasyHandle $easy

Returns

array

applyMethod()

applyMethod(\GuzzleHttp\Handler\EasyHandle  $easy, array  $conf) : void

Parameters

\GuzzleHttp\Handler\EasyHandle $easy
array $conf

applyBody()

applyBody(\Psr\Http\Message\RequestInterface  $request, array  $options, array  $conf) : void

Parameters

\Psr\Http\Message\RequestInterface $request
array $options
array $conf

applyHeaders()

applyHeaders(\GuzzleHttp\Handler\EasyHandle  $easy, array  $conf) : void

Parameters

\GuzzleHttp\Handler\EasyHandle $easy
array $conf

removeHeader()

removeHeader(string  $name, array  $options) : void

Remove a header from the options array.

Parameters

string $name

Case-insensitive header to remove

array $options

Array of options to modify

applyHandlerOptions()

applyHandlerOptions(\GuzzleHttp\Handler\EasyHandle  $easy, array  $conf) : void

Parameters

\GuzzleHttp\Handler\EasyHandle $easy
array $conf

retryFailedRewind()

retryFailedRewind(callable  $handler, \GuzzleHttp\Handler\EasyHandle  $easy, array  $ctx) : \GuzzleHttp\Promise\PromiseInterface

This function ensures that a response was set on a transaction. If one was not set, then the request is retried if possible. This error typically means you are sending a payload, curl encountered a "Connection died, retrying a fresh connect" error, tried to rewind the stream, and then encountered a "necessary data rewind wasn't possible" error, causing the request to be sent through curl_multi_info_read() without an error status.

Parameters

callable $handler
\GuzzleHttp\Handler\EasyHandle $easy
array $ctx

Returns

\GuzzleHttp\Promise\PromiseInterface —

createHeaderFn()

createHeaderFn(\GuzzleHttp\Handler\EasyHandle  $easy) : callable

Parameters

\GuzzleHttp\Handler\EasyHandle $easy

Returns

callable —