gpt4 book ai didi

http - HTTP API 速率限制 HTTP 响应 header 的示例

转载 作者:可可西里 更新时间:2023-11-01 15:03:35 28 4
gpt4 key购买 nike

其中一个附加 HTTP 状态代码 (RFC6585) 是

在哪里可以找到对这种 HTTP 响应状态有用的 HTTP/REST API 限速 HTTP 响应 header 示例?

最佳答案

以下是 HTTP API 限速 HTTP 响应 header 的一些示例。摘自四种常见的 REST API:Github、Vimeo、Twitter 和 Imgur:

Github 限速 http://developer.github.com/v3/#rate-limiting

#=============================#=============================================#
# HTTP Header # Description #
#=============================#=============================================#
| X-RateLimit-Limit | Request limit per hour |
+-----------------------------+---------------------------------------------+
| X-RateLimit-Remaining | The number of requests left for the time |
| | window |
+-----------------------------+---------------------------------------------+

Vimeo 速率限制 http://developer.vimeo.com/guidelines/rate-limiting

#=============================#=============================================#
# 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 |
+-----------------------------+---------------------------------------------+

Twitter REST API 速率限制 https://dev.twitter.com/docs/rate-limiting/1.1

Note: Twitter uses headers with similar names like Vimeo, but has another dash in each name.

#=============================#=============================================#
# 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 |
+-----------------------------+---------------------------------------------+

Imgur API 速率限制 http://api.imgur.com/

#=============================#=============================================#
# 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 |
+-----------------------------+---------------------------------------------+

关于http - HTTP API 速率限制 HTTP 响应 header 的示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16022624/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com