Documentation

GuzzleHandler
in package

A request handler that sends PSR-7-compatible requests with Guzzle 5.

The handler accepts a PSR-7 Request object and an array of transfer options and returns a Guzzle 6 Promise. The promise is either resolved with a PSR-7 Response object or rejected with an array of error data.

Tags
codeCoverageIgnore

Table of Contents

$client  : ClientInterface
$validOptions  : mixed
__construct()  : mixed
__invoke()  : Promise|PromiseInterface
createGuzzleRequest()  : mixed
createPsr7Response()  : mixed
prepareErrorData()  : mixed

Properties

$validOptions

private static mixed $validOptions = ['proxy' => true, 'expect' => true, 'cert' => true, 'verify' => true, 'timeout' => true, 'debug' => true, 'connect_timeout' => true, 'stream' => true, 'delay' => true, 'sink' => true]

Methods

createGuzzleRequest()

private createGuzzleRequest(RequestInterface $psrRequest, array<string|int, mixed> $options) : mixed
Parameters
$psrRequest : RequestInterface
$options : array<string|int, mixed>
Return values
mixed

createPsr7Response()

private createPsr7Response(ResponseInterface $response) : mixed
Parameters
$response : ResponseInterface
Return values
mixed

prepareErrorData()

private prepareErrorData(Exception $e) : mixed
Parameters
$e : Exception
Return values
mixed

Search results