tap(callable $before = null, callable $after = null) : callable
Middleware that invokes a callback before and after sending a request.
The provided listener cannot modify or alter the response. It simply
"taps" into the chain to be notified before returning the promise. The
before listener accepts a request and options array, and the after
listener accepts a request, options array, and response promise.
Function to invoke before forwarding the request.
Function invoked after forwarding.
Returns a function that accepts the next handler.