FlexibleHttpClient
in package
implements
HttpClient, HttpAsyncClient
uses
HttpClientDecorator, HttpAsyncClientDecorator
FinalYes
A flexible http client, which implements both interface and will emulate one contract, the other, or none at all depending on the injected client contract.
Tags
Table of Contents
Interfaces
- HttpClient
- HttpAsyncClient
- Sends a PSR-7 Request in an asynchronous way by returning a Promise.
Properties
Methods
- __construct() : mixed
- sendAsyncRequest() : mixed
- {@inheritdoc}
- sendRequest() : ResponseInterface
- {@inheritdoc}
Properties
$httpAsyncClient
protected
HttpAsyncClient
$httpAsyncClient
$httpClient
protected
ClientInterface
$httpClient
Methods
__construct()
public
__construct(ClientInterface|HttpAsyncClient $client) : mixed
Parameters
- $client : ClientInterface|HttpAsyncClient
sendAsyncRequest()
{@inheritdoc}
public
sendAsyncRequest(RequestInterface $request) : mixed
Parameters
- $request : RequestInterface
Tags
sendRequest()
{@inheritdoc}
public
sendRequest(RequestInterface $request) : ResponseInterface
Parameters
- $request : RequestInterface