addInterceptors method

dynamic addInterceptors({
  1. InterceptorSendCallback? requestInterceptor,
  2. InterceptorSuccessCallback? responseInterceptor,
  3. InterceptorErrorCallback? errorInterceptor,
})

Implementation

addInterceptors({
  InterceptorSendCallback? requestInterceptor,
  InterceptorSuccessCallback? responseInterceptor,
  InterceptorErrorCallback? errorInterceptor,
}) {
  httpClient.interceptors.add(InterceptorsWrapper(
    onRequest: requestInterceptor,
    onResponse: responseInterceptor,
    onError: errorInterceptor,
  ));
}