function Middleware::mapRequest
Middleware that applies a map function to the request before passing to the next handler.
Parameters
callable $fn Function that accepts a RequestInterface and returns: a RequestInterface.
File
-
vendor/
guzzlehttp/ guzzle/ src/ Middleware.php, line 244
Class
- Middleware
- Functions used to create and wrap handlers with handler middleware.
Namespace
GuzzleHttpCode
public static function mapRequest(callable $fn) : callable {
return static function (callable $handler) use ($fn) : callable {
return static function (RequestInterface $request, array $options) use ($handler, $fn) {
return $handler($fn($request), $options);
};
};
}