M8R*_*w5r 73 api rest http rate-limiting http-status-code-429
其中一个附加HTTP状态代码(RFC6585)是
在哪里可以找到对此HTTP响应状态有用的HTTP/REST API速率限制HTTP响应头的示例?
M8R*_*w5r 118
以下是HTTP API速率限制HTTP响应标头的一些示例.取自四个常见的REST API:Github,Vimeo,Twitter和Imgur:
#=============================#=============================================#
# HTTP Header # Description #
#=============================#=============================================#
| X-RateLimit-Limit | Request limit per hour |
+-----------------------------+---------------------------------------------+
| X-RateLimit-Remaining | The number of requests left for the time |
| | window |
+-----------------------------+---------------------------------------------+
Run Code Online (Sandbox Code Playgroud)
#=============================#=============================================#
# HTTP Header # Description #
#=============================#=============================================#
| X-RateLimit-Limit | Request limit per day / per 5 minutes |
+-----------------------------+---------------------------------------------+
| X-RateLimit-Remaining | The number of requests left for the time |
| | window |
+-----------------------------+---------------------------------------------+
| X-RateLimit-Reset | The remaining window before the rate limit |
| | resets in UTC epoch seconds |
+-----------------------------+---------------------------------------------+
Run Code Online (Sandbox Code Playgroud)
注意: Twitter使用类似名称的标题,如Vimeo,但每个名称中都有另一个短划线.
#=============================#=============================================#
# HTTP Header # Description #
#=============================#=============================================#
| X-Rate-Limit-Limit | The rate limit ceiling for that given |
| | request |
+-----------------------------+---------------------------------------------+
| X-Rate-Limit-Remaining | The number of requests left for the |
| | 15 minute window |
+-----------------------------+---------------------------------------------+
| X-Rate-Limit-Reset | The remaining window before the rate limit |
| | resets in UTC epoch seconds |
+-----------------------------+---------------------------------------------+
Run Code Online (Sandbox Code Playgroud)
#=============================#=============================================#
# HTTP Header # Description #
#=============================#=============================================#
| X-RateLimit-UserLimit | Total credits that can be allocated |
+-----------------------------+---------------------------------------------+
| X-RateLimit-UserRemaining | Total credits available |
+-----------------------------+---------------------------------------------+
| X-RateLimit-UserReset | Timestamp (unix epoch) for when the credits |
| | will be reset |
+-----------------------------+---------------------------------------------+
| X-RateLimit-ClientLimit | Total credits that can be allocated for the |
| | application in a day |
+-----------------------------+---------------------------------------------+
| X-RateLimit-ClientRemaining | Total credits remaining for the application |
| | in a day |
+-----------------------------+---------------------------------------------+
Run Code Online (Sandbox Code Playgroud)
Rae*_*ald 25
除了API特定的标题之外,不要忘记简单的标准Retry-After
标题.
归档时间: |
|
查看次数: |
49672 次 |
最近记录: |