http-status-code-429

urllib2 HTTP error 429

那年仲夏 提交于 2019-11-30 07:10:32
So I have a list of sub-reddits and I'm using urllib to open them. As I go through them eventually urllib fails with: urllib2.HTTPError: HTTP Error 429: Unknown Doing some research I found that reddit limits the ammount of requests to their servers by IP: Make no more than one request every two seconds. There's some allowance for bursts of requests, but keep it sane. In general, keep it to no more than 30 requests in a minute. So I figured I'd use time.sleep() to limit my requests to one page each 10 seconds. This ends up failing just as well. The quote above is grabbed from the reddit API

How to return HTTP 429?

时光总嘲笑我的痴心妄想 提交于 2019-11-30 04:41:13
I'm implementing an API using WCF and the specification says to return HTTP 429 in certain circumstances. Normally I'd simply write: throw new WebFaultException(HttpStatusCode.NotFound); However the HttpStatusCode enum does not contain a 429. I can obviously cast to the enum throw new WebFaultException((HttpStatusCode)429); However I'm worried that this will not produce the correct result to the application calling my API. What's the best way to create extend the HttpStatusCode and send valid (but unsupported) HTTP statuses? From the C# Language Specification 5.0 : The set of values that an

Examples of HTTP API Rate Limiting HTTP Response headers [closed]

↘锁芯ラ 提交于 2019-11-29 18:41:01
One of the Additional HTTP Status Codes ( RFC6585 ) is 429 Too Many Requests Where can I find examples of HTTP / REST API Rate-Limiting HTTP response headers that are useful with this HTTP response status? M8R-1jmw5r Here are some examples of HTTP API Rate Limiting HTTP Response headers. Taken from four common REST APIs: Github, Vimeo, Twitter and Imgur: Github Rate Limiting http://developer.github.com/v3/#rate-limiting #=============================#=============================================# # HTTP Header # Description # #=============================#=====================================

PHP (Apache) silently converting HTTP 429 and others to 500

早过忘川 提交于 2019-11-29 18:17:23
问题 I just discovered an oddity in PHP's header() method silently converting some of my statuses to 500. Since I had no luck in finding mention of this behavior in various web searches, I'm adding this here in the hope of saving others some aggravation, but also to ask if anyone has discovered a better workaround (either with PHP or Zend1) than I've come up with. Given a simple PHP script like: <?php header('HTTP/1.1 429'); echo "Too Many Requests\n"; I would expect to receive something like:

urllib2 HTTP error 429

廉价感情. 提交于 2019-11-29 08:48:05
问题 So I have a list of sub-reddits and I'm using urllib to open them. As I go through them eventually urllib fails with: urllib2.HTTPError: HTTP Error 429: Unknown Doing some research I found that reddit limits the ammount of requests to their servers by IP: Make no more than one request every two seconds. There's some allowance for bursts of requests, but keep it sane. In general, keep it to no more than 30 requests in a minute. So I figured I'd use time.sleep() to limit my requests to one page

How to return HTTP 429?

柔情痞子 提交于 2019-11-29 01:29:13
问题 I'm implementing an API using WCF and the specification says to return HTTP 429 in certain circumstances. Normally I'd simply write: throw new WebFaultException(HttpStatusCode.NotFound); However the HttpStatusCode enum does not contain a 429. I can obviously cast to the enum throw new WebFaultException((HttpStatusCode)429); However I'm worried that this will not produce the correct result to the application calling my API. What's the best way to create extend the HttpStatusCode and send valid