use GuzzleHttp\Middleware;
Here's an example of using the tap middleware to see what request is sent over the wire.
// Create a middleware that echoes parts of the request.
$tapMiddleware = Middleware::tap(function ($request) {
echo $request->getHeaderLine('Content-Type');
// application/json
echo $request->getBody();
// {"foo":"bar"}
});
См.
https://docs.guzzlephp.org/en/stable/request-optio...