onRequest method

  1. @override
void onRequest(
  1. RequestOptions options,
  2. RequestInterceptorHandler handler
)

Called when the request is about to be sent.

Implementation

@override
void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
  LoggerUtil().logD(
      "请求拦截 onRequest \n请求类型:${options.method} \n请求PATH: ${options.baseUrl + options.path} \n请求数据: ${options.data.toString()} \n请求参数: ${options.queryParameters.toString()} \n请求头: ${options.headers.toString()}",
      tag: _TAG);
  super.onRequest(options, handler);
}