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

Add response headers to ApiResponse to gather API limits information #27

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

Conversation

athlan
Copy link

@athlan athlan commented Sep 25, 2013

ApiResponse has been modified, headers has been stored.

Use getRateLimit() and getRateLimitRemaining() from ApiResponse to get info about current API usage.

@galen
Copy link
Owner

galen commented Sep 30, 2013

Can you show an example of how this can be utilizied?

@athlan
Copy link
Author

athlan commented Sep 30, 2013

Of course. Our service using this library often reaches Instagram's limits so we have to switch API keys by round-robin or read these limits. We also generates the alerts if API client will soon reach limits based on header information (not hardcoded value).

@galen
Copy link
Owner

galen commented Sep 30, 2013

I mean in code. Can you show me how you use it?

On Sep 30, 2013, at 5:44 PM, Piotr Pelczar [email protected] wrote:

Of course. Our service using this library often reaches Instagram's limits so we have to switch API keys by round-robin or read these limits. We also generates the alerts if API client will soon reach limits based on header information (not hardcoded value).


Reply to this email directly or view it on GitHub.

@mpatnode
Copy link

I just implemented this without looking at the open PR's, but I did it a little differently. Having it hang off the response isn't very useful to the client. I'll pull and open a PR.

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.

3 participants