interceptRequest method

  1. @mustCallSuper
Future<HttpResponse> interceptRequest(
  1. ClientType client,
  2. HttpRequest request,
  3. Future<HttpResponse> next(
    1. HttpRequest
    )
)

Called whenever a request is made using a client's HttpHandler.

Plugins that implement this method are not required to call the next method.

Implementation

@mustCallSuper
Future<HttpResponse> interceptRequest(ClientType client, HttpRequest request, Future<HttpResponse> Function(HttpRequest) next) {
  final state = _states[client];
  return state?.interceptRequest(client, request, next) ?? next(request);
}