Implement RequestInterceptor
class or define function with following signature FutureOr<Request> RequestInterceptorFunc(Request request)
Request interceptor are called just before sending request
final chopper = ChopperClient(
interceptors: [
(request) async => request.copyWith(body: {}),
]
);
Implement ResponseInterceptor
class or define function with following signature FutureOr<Response> ResponseInterceptorFunc(Response response)
{% hint style="info" %} Called after successful or failed request {% endhint %}
final chopper = ChopperClient(
interceptors: [
(Response response) async => response.replace(body: {}),
]
);