Documentation

Plugin

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
author

Joel Wurtz joel.wurtz@gmail.com

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
see
http://docs.php-http.org/en/latest/plugins/build-your-own.html
Return values
Promise

Resolves a PSR-7 Response or fails with an Http\Client\Exception (The same as HttpAsyncClient)


        
On this page

Search results