-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
Description
It would be nice to have the ability to add middlewares to the request.
I came up with this because I had the case that I use an API to get projects.
The API has a request limit, after that, it sends back a 429. In this case, it would be nice to have the ability to add a middleware that can react to that.
Or in other cases where if you have a certain header to do something with it before it comes to the actual logic.
<?php
$middlewares = Middlewares::create();
$middlewares->push($instanceOfMyMiddleware);
$this->client->request('GET', 'https://my-example-api.com/endpoint', ['middlewares' => $middlewares]);
kaznovac, webda2l, phcorp, Max-Yudin, edditor and 11 morePabloKowalczyk