\GuzzleHttp\HandlerStreamHandler

HTTP handler that uses PHP's HTTP stream wrapper.

Summary

Methods
Properties
Constants
__invoke()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
invokeStats()
createResponse()
createSink()
checkDecode()
drain()
createResource()
createStream()
resolveHost()
getDefaultContext()
add_proxy()
parse_proxy()
add_timeout()
add_verify()
add_cert()
add_progress()
add_debug()
addNotification()
callArray()
$lastHeaders
N/A

Properties

$lastHeaders

$lastHeaders : array

Type

array

Methods

__invoke()

__invoke(\Psr\Http\Message\RequestInterface  $request, array  $options) : \GuzzleHttp\Promise\PromiseInterface

Sends an HTTP request.

Parameters

\Psr\Http\Message\RequestInterface $request

Request to send.

array $options

Request transfer options.

Returns

\GuzzleHttp\Promise\PromiseInterface —

invokeStats()

invokeStats(array  $options, \Psr\Http\Message\RequestInterface  $request, ?float  $startTime, \Psr\Http\Message\ResponseInterface  $response = null, \Throwable  $error = null) : void

Parameters

array $options
\Psr\Http\Message\RequestInterface $request
?float $startTime
\Psr\Http\Message\ResponseInterface $response
\Throwable $error

createResponse()

createResponse(\Psr\Http\Message\RequestInterface  $request, array  $options, resource  $stream, ?float  $startTime) : \GuzzleHttp\Promise\PromiseInterface

Parameters

\Psr\Http\Message\RequestInterface $request
array $options
resource $stream
?float $startTime

Returns

\GuzzleHttp\Promise\PromiseInterface —

createSink()

createSink(\Psr\Http\Message\StreamInterface  $stream, array  $options) : \Psr\Http\Message\StreamInterface

Parameters

\Psr\Http\Message\StreamInterface $stream
array $options

Returns

\Psr\Http\Message\StreamInterface —

checkDecode()

checkDecode(array  $options, array  $headers, resource  $stream) : array

Parameters

array $options
array $headers
resource $stream

Returns

array —

drain()

drain(\Psr\Http\Message\StreamInterface  $source, \Psr\Http\Message\StreamInterface  $sink, string  $contentLength) : \Psr\Http\Message\StreamInterface

Drains the source stream into the "sink" client option.

Parameters

\Psr\Http\Message\StreamInterface $source
\Psr\Http\Message\StreamInterface $sink
string $contentLength

Header specifying the amount of data to read.

Throws

\RuntimeException

when the sink option is invalid.

Returns

\Psr\Http\Message\StreamInterface —

createResource()

createResource(callable  $callback) : resource

Create a resource and check to ensure it was created successfully

Parameters

callable $callback

Callable that returns stream resource

Throws

\RuntimeException

on error

Returns

resource —

createStream()

createStream(\Psr\Http\Message\RequestInterface  $request, array  $options) : resource

Parameters

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

Returns

resource —

resolveHost()

resolveHost(\Psr\Http\Message\RequestInterface  $request, array  $options) : \Psr\Http\Message\UriInterface

Parameters

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

Returns

\Psr\Http\Message\UriInterface —

getDefaultContext()

getDefaultContext(\Psr\Http\Message\RequestInterface  $request) : array

Parameters

\Psr\Http\Message\RequestInterface $request

Returns

array —

add_proxy()

add_proxy(\Psr\Http\Message\RequestInterface  $request, array  $options, mixed  $value, array  $params) : void

Parameters

\Psr\Http\Message\RequestInterface $request
array $options
mixed $value

as passed via Request transfer options.

array $params

parse_proxy()

parse_proxy(string  $url) : array

Parses the given proxy URL to make it compatible with the format PHP's stream context expects.

Parameters

string $url

Returns

array —

add_timeout()

add_timeout(\Psr\Http\Message\RequestInterface  $request, array  $options, mixed  $value, array  $params) : void

Parameters

\Psr\Http\Message\RequestInterface $request
array $options
mixed $value

as passed via Request transfer options.

array $params

add_verify()

add_verify(\Psr\Http\Message\RequestInterface  $request, array  $options, mixed  $value, array  $params) : void

Parameters

\Psr\Http\Message\RequestInterface $request
array $options
mixed $value

as passed via Request transfer options.

array $params

add_cert()

add_cert(\Psr\Http\Message\RequestInterface  $request, array  $options, mixed  $value, array  $params) : void

Parameters

\Psr\Http\Message\RequestInterface $request
array $options
mixed $value

as passed via Request transfer options.

array $params

add_progress()

add_progress(\Psr\Http\Message\RequestInterface  $request, array  $options, mixed  $value, array  $params) : void

Parameters

\Psr\Http\Message\RequestInterface $request
array $options
mixed $value

as passed via Request transfer options.

array $params

add_debug()

add_debug(\Psr\Http\Message\RequestInterface  $request, array  $options, mixed  $value, array  $params) : void

Parameters

\Psr\Http\Message\RequestInterface $request
array $options
mixed $value

as passed via Request transfer options.

array $params

addNotification()

addNotification(array  $params, callable  $notify) : void

Parameters

array $params
callable $notify

callArray()

callArray(array  $functions) : callable

Parameters

array $functions

Returns

callable —