Provide Response headers access in on_error method #503
Labels
No labels
Bug
Enhancement
Feature Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: code/twython#503
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi,
Twitter streaming api is very sensitive on number of connections attempts in a window time or number of active connections for same api keys (the twitter app).
In such a case, http error 420 is raised and, according to documentation, a new connection attempt should happen after the Retry-After header that is being set in the Response.
Another case is http error 429 and x-rate-limit-reset response header.
I think this logic should be implemented either directly in Twython or, at least, the Twython lib should give access to response.headers in the
on_errormethod, so that the developer can instruct the client code to wait/sleep for the right amount of time before to retry. Currently, the on_error method takes only error status code and the binary response.content, giving no possibility to inspect those headers.Merged... years later, but merged.
Thank you!