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

Allow access to response headers, especially in errors #38

Open
jfsiii opened this issue Mar 11, 2012 · 0 comments
Open

Allow access to response headers, especially in errors #38

jfsiii opened this issue Mar 11, 2012 · 0 comments

Comments

@jfsiii
Copy link

jfsiii commented Mar 11, 2012

This is most valuable for rate limit errors. Currently, the error object when a client is rate limited is:

{ [Error: HTTP Error 400: Bad Request]
  statusCode: 400,
  data: '{"error":"Rate limit exceeded. Clients may not make more than 350 requests per hour.","request":"\\/1\\/lists.json?screen_name=JFSIII&cursor=-1"}' }

However, this doesn't inform the client when their limiting will end. That information is available via the X-RateLimit-Reset header. The value is the UNIX timestamp when the limit will be lifted.

Even successful connections have useful information. Most notably X-RateLimit-Remaining which informs the client how many calls are left before they get limited.

I'm just getting started with this library, so I don't have any suggestions for the preferred way to make them available. I only know that they are a requirement for clients. They are so important, I feel like I must have missed their inclusion. If so, I apologize for the noisy ticket and ask that you point me to the documentation or provide some example code.

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

No branches or pull requests

1 participant