HumHub Documentation (unofficial)

HttplugClient
in package
implements HttpClient, HttpAsyncClient, RequestFactory, StreamFactory, UriFactory, ResetInterface

FinalYes

An adapter to turn a Symfony HttpClientInterface into an Httplug client.

Run "composer require nyholm/psr7" to install an efficient implementation of response and stream factories with flex-provided autowiring aliases.

Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

Interfaces

HttpClient
HttpAsyncClient
RequestFactory
StreamFactory
UriFactory
ResetInterface
Provides a way to reset an object to its initial state.

Properties

$client  : mixed
$promisePool  : SplObjectStorage<ResponseInterface, Promise}>|null
$responseFactory  : mixed
$streamFactory  : mixed
$waitLoop  : mixed

Methods

__construct()  : mixed
__destruct()  : mixed
__sleep()  : array<string|int, mixed>
__wakeup()  : mixed
createRequest()  : RequestInterface
{@inheritdoc}
createStream()  : StreamInterface
{@inheritdoc}
createUri()  : UriInterface
{@inheritdoc}
reset()  : mixed
sendAsyncRequest()  : HttplugPromise
{@inheritdoc}
sendRequest()  : ResponseInterface
{@inheritdoc}
wait()  : int
Resolves pending promises that complete before the timeouts are reached.
sendPsr7Request()  : ResponseInterface

Properties

Methods

__sleep()

public __sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>

createRequest()

{@inheritdoc}

public createRequest(mixed $method, mixed $uri[, array<string|int, mixed> $headers = [] ][, mixed $body = null ][, mixed $protocolVersion = '1.1' ]) : RequestInterface
Parameters
$method : mixed
$uri : mixed
$headers : array<string|int, mixed> = []
$body : mixed = null
$protocolVersion : mixed = '1.1'
Return values
RequestInterface

wait()

Resolves pending promises that complete before the timeouts are reached.

public wait([float|null $maxDuration = null ][, float|null $idleTimeout = null ]) : int

When $maxDuration is null and $idleTimeout is reached, promises are rejected.

Parameters
$maxDuration : float|null = null
$idleTimeout : float|null = null
Return values
int

The number of remaining pending promises


        
On this page

Search results