本文介绍了API已超出配额的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在文档我们可以发现,的限值是根据一个跟踪你每小时发送的请求数量的移动窗口上(HTTPS://developer.foursquare .COM /概述/ ratelimits),但在实践中我的限速是不充电,即使我等待几分钟。

In the documentation we can find that The limits are based on a moving window that tracks the number of requests you send per hour. (https://developer.foursquare.com/overview/ratelimits) but in the practice my rate limit isn't recharged even if I wait several minutes.

发生了什么?难道他们改变API速率限制的实施?

What happened? Did they change the implementation of API rate limits?

推荐答案

窗口仍应更新实时更新。

The window should still update be updating in real time.

需要明确的是,如果你的限速为500,在11点,你发送5个请求,在X-RateLimit,其余将是495.如果您稍等几分钟到11:05,并发送另一个请求,剩下的X-限速将是494 - 它不会还没有复位

To be clear, if your rate limit is 500, at 11:00, you send 5 requests, the X-RateLimit-Remaining will be 495. If you wait a few minutes to 11:05, and send another request, X-Rate-Limit remaining will be 494 -- it won't have reset yet.

这不,直到12时01分,你会回来,你会在11:00取得了5项要求。所以,如果你在12:01再次提出要求,你的极限是498(-1你只是做了要求,为-1 11:05要求)。 12:06再次请求,并且你会回升到499(完整的上限,减去你只是使用了什么)。

It's not until 12:01 that you'll get back the 5 requests that you'd made at 11:00. So, if you request again at 12:01, your limit would be 498 (-1 for the request you just did, -1 for the 11:05 request). Requesting again at 12:06, and you'll be back up to 499 (the full limit, minus what you just used).

这篇关于API已超出配额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 11:02