handleEndWithRequestOption method

void handleEndWithRequestOption(
  1. RequestOptions requestOptions
)

Implementation

void handleEndWithRequestOption(RequestOptions requestOptions) {
  final Map<String, dynamic> requestHeaders = requestOptions.headers;
  if (requestHeaders['network_debounce'] != null && requestHeaders['network_debounce'] == 'true') {
    //请求完成之后移除CancelToken,和 Params Map
    final url = requestOptions.uri.path;
    final method = requestOptions.method;
    Map<String, dynamic>? params = _generateParameters(method, requestOptions);

    final urlKey = _generateKeyByMethodUrl(method, url);
    _urlParamsMap.remove(urlKey);

    removeCancelToken(url, method, params);

    LoggerUtil().logD("*************网络请求去重的全部流程完成,移除Map内存缓存完成***************", tag: _TAG);
  }
}