Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Fitbit API rate limiting headers #136

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

epall
Copy link

@epall epall commented Jun 19, 2018

Fitbit's API returns several headers that help clients know how close they are to having their requests denied with an HTTP 429 error. By exposing the rate limiting-related headers as fields on the Fitbit client object, we help consumers make better decisions about how and when to make requests.

Based on that information, we can infer when the next request would be refused with an HTTP 429 response due to rate limiting. Instead of making that request, we can avoid it and throw an informative error message to consumers.

epall added 2 commits June 18, 2018 18:22
Fitbit's API returns several headers that help clients know how close they are to having their requests denied with an HTTP 429 error. By exposing the rate limiting-related headers as fields on the Fitbit client object, we help consumers make better decisions about how and when to make requests.
Fitbit gives us enough information in HTTP response headers to know when the next request would be refused with an HTTP 429 response due to rate limiting. Instead of making that request, we can avoid it and throw an informative error message to consumers.
@epall
Copy link
Author

epall commented Jun 20, 2018

Whoops! Looks like I independently tackled #134 here for the same reason (intraday download over many days).

@jottr
Copy link

jottr commented Dec 15, 2024

Can the maintainers please share their reason why this was not merged?
It's a useful feature, and I'm currently monkey patching this in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants