dropbox - 如何处理 Dropbox API 中的速率限制?

标签 dropbox dropbox-api httplib

Dropbox API 文档指出,如果受到速率限制,将返回 503 HTTP 状态代码,并带有“Retry-After” header 。然而,在我怀疑是速率限制的情况下,这是我得到的实际响应:

[503] Error parsing response body or headers: Body - '\r\n<html>\r\n<head><title>Dropbox 
- 5xx</title>\r\n<link href="https://www.dropbox.com/static/css/ Headers - {'transfer-
encoding': 'chunked', 'server': 'nginx', 'connection': 'keep-alive', 'cache-control': 
'no-cache', 'date': 'Sat, 31 May 2014 12:55:40 GMT', 'content-type': 'text/html'}

(实际上这是dropbox.rest.ErrorResponse as estr(e))

没有 Retry-After header ,因此这可能不是速率限制的情况。如果是这样的话,那么我不知道这个错误告诉我什么。

有人有我可以测试的实际速率限制响应的示例吗?

最佳答案

该响应仅表明一些随机服务器故障。您应该再次尝试该请求。正如您所指出的,此场景记录在 Core API Reference标准 API 错误部分中。 :

503

If the response includes the Retry-After header, this means your ... app is being rate limited. Otherwise, this indicates a transient server error, and your app should retry its request.

关于dropbox - 如何处理 Dropbox API 中的速率限制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24233673/

相关文章:

python - 使用python api递归计算每个保管箱文件夹的大小

python - 跟踪文件夹更改/Dropbox 更改

c++ - 从 C++ 中的网站读取文本

python - 如何使用 httplib 发布 unicode 字符?

python - 如何使用 Py2Neo 修复 Linux 上的 IncompleteRead 错误

javascript - Dropbox 与 UI5 集成

javascript - 如何将 dropbox.js 与 OAuth 1 结合使用

javascript - Dropbox API - 文件读取和上传node.js

python - 如何使用 v2 api 列出我的保管箱中的所有文件和文件夹

python - SSL 握手错误 : [Errno 1]