getCachedRequestURL method

HttpResponse? getCachedRequestURL(
  1. HttpMethod method,
  2. String requestURL, {
  3. Credential? authorization,
  4. Map<String, String?>? queryParameters,
  5. Object? body,
  6. String? contentType,
  7. String? accept,
})

Gets a request already in cache using httpClient and requestURL.

Implementation

HttpResponse? getCachedRequestURL(HttpMethod method, String requestURL,
    {Credential? authorization,
    Map<String, String?>? queryParameters,
    Object? body,
    String? contentType,
    String? accept}) {
  var cacheRequest = _CacheRequest(
      method, requestURL, queryParameters, body, contentType, accept);
  var cachedResponse = _cache[cacheRequest];

  if (cachedResponse != null) {
    _log('Cached request: $method > $requestURL > $cachedResponse');
    return cachedResponse;
  }

  return null;
}