Plugin
in
A plugin is a middleware to transform the request and/or the response.
The plugin can:
- break the chain and return a response
- dispatch the request to the next middleware
- restart the request
Tags
Table of Contents
Methods
- handleRequest() : Promise
- Handle the request and return the response coming from the next callable.
Methods
handleRequest()
Handle the request and return the response coming from the next callable.
public
handleRequest(RequestInterface $request, callable(RequestInterface): Promise $next, callable(RequestInterface): Promise $first) : Promise
Parameters
- $request : RequestInterface
- $next : callable(RequestInterface): Promise
-
Next middleware in the chain, the request is passed as the first argument
- $first : callable(RequestInterface): Promise
-
First middleware in the chain, used to to restart a request
Tags
Return values
Promise —Resolves a PSR-7 Response or fails with an Http\Client\Exception (The same as HttpAsyncClient)