HttpClientRouterInterface
extends
HttpClient, HttpAsyncClient
in
Route a request to a specific client in the stack based using a RequestMatcher.
This is not a HttpClientPool client because it uses a matcher to select the client.
Tags
Table of Contents
Methods
- addClient() : void
- Add a client to the router.
- sendAsyncRequest() : Promise
- Sends a PSR-7 request in an asynchronous way.
- sendRequest() : ResponseInterface
- Sends a PSR-7 request and returns a PSR-7 response.
Methods
addClient()
Add a client to the router.
public
addClient(ClientInterface|HttpAsyncClient $client, RequestMatcher $requestMatcher) : void
Parameters
- $client : ClientInterface|HttpAsyncClient
- $requestMatcher : RequestMatcher
sendAsyncRequest()
Sends a PSR-7 request in an asynchronous way.
public
sendAsyncRequest(RequestInterface $request) : Promise
Exceptions related to processing the request are available from the returned Promise.
Parameters
- $request : RequestInterface
Tags
Return values
Promise —resolves a PSR-7 Response or fails with an Http\Client\Exception
sendRequest()
Sends a PSR-7 request and returns a PSR-7 response.
public
sendRequest(RequestInterface $request) : ResponseInterface
Parameters
- $request : RequestInterface