stravalib.util.limiter.get_rates_from_response_headers#

stravalib.util.limiter.get_rates_from_response_headers(headers: dict[str, str], method: Literal['GET', 'POST', 'PUT', 'DELETE']) RequestRate | None[source]#

Returns a namedtuple with values for short - and long usage and limit rates found in provided HTTP response headers

Parameters:
  • headers (dict) – HTTP response headers

  • method (RequestMethod) – HTTP request method corresponding to the provided response headers

Returns:

namedtuple with request rates or None if no rate-limit headers present in response.

Return type:

Optional[RequestRate]