Add 'retryAfter' property to 'Too Many Request' Error
See original GitHub issueThis is a number in the Retry-After
header, when the statuscode is 429
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:11
Top Results From Across the Web
How to Fix 429 Too Many Requests Error - Kinsta
The HTTP 429 error is returned when too many requests are made to a page within a short period of time. Find out...
Read more >Retry-After - HTTP - MDN Web Docs
When sent with a 429 (Too Many Requests) response, this indicates how long to wait before making a new request.
Read more >Implementing 429 retries and throttling for API rate-limits - Anvil
Learn how to handle 429 Too Many Requests responses when consuming 3rd party APIs.
Read more >c# - Too many requests exception on HttpWebRequest ...
Add this to your request header: Retry-After: 120. Like this on code : request.Headers.Add("Retry-After", "120");.
Read more >Error: 429 Too Many Requests — You've been rate limited
While many services will publish their limits like in the GitHub example above, others may include limits as a property on responses, or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This PR https://github.com/thelinmichael/spotify-web-api-node/pull/237 adds the entire headers object to the error, so consumers can take advantage of the
retry-after
header. For example, could do something like:This creates a wrapper around the request and retries it if the request fails
@gwynnebaer if i see correctly, using
superagent-throttle
only allows you to throttle all requests, rather than using theRetry-After
header.@settheset chose to at first automatically retry bases on the
Retry-After
header but reverted it back to passing the headers to the error object. https://github.com/thelinmichael/spotify-web-api-node/blob/master/src/http-manager.js#L88Passing the header along with the error object allows one to make use of RxJs’ retryWhen operator and supplying the delay operator the
Retry-After
value.