pygeoogc.cache_keys#

Functions for creating unique keys based on web request parameters.

This module is based on the aiohttp-client-cache package, which is licensed under the MIT license. See the LICENSE file for more details.

Module Contents#

pygeoogc.cache_keys.create_request_key(method, url, params=None, data=None, json=None)#

Create a unique cache key based on request details.

Parameters:
  • method (str) – The HTTP method used in the request. Must be either “GET” or “POST”.

  • url (str or yarl.URL) – The URL of the request.

  • params (dict or list or str or None, optional) – The query parameters of the request. Default is None.

  • data (dict or None, optional) – The data of the request. Default is None.

  • json (dict or None, optional) – The JSON data of the request. Default is None.

Returns:

str – The unique cache key based on the request details.

Return type:

str