限制HTTP响应头HTTP API速率的例子 [英] Examples of HTTP API Rate Limiting HTTP Response headers
本文介绍了限制HTTP响应头HTTP API速率的例子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
一个附加HTTP状态$ C $的CS( RFC6585 )是
我在哪里可以找到HTTP的例子/ REST API速率限制HTTP响应头了与此HTTP响应状态有用吗?
解决方案
下面是限制HTTP响应头HTTP API速率的一些例子。 Github上,Vimeo的,Twitter和Imgur:从四种常见的REST API的拍摄
Github的速率限制<一个href=\"http://developer.github.com/v3/#rate-limiting\">http://developer.github.com/v3/#rate-limiting
##============================= ======= ======================================#
#HTTP头#说明#
##============================= =================== ==========================#
|的X RateLimit限价|每小时请求限制|
+ ----------------------------- + ------------------- -------------------------- +
|的X RateLimit,剩余|剩下的请求数的时间|
| |窗口|
+ ----------------------------- + ------------------- -------------------------- +
Vimeo的速率限制<一个href=\"http://developer.vimeo.com/guidelines/rate-limiting\">http://developer.vimeo.com/guidelines/rate-limiting
##============================= ======= ======================================#
#HTTP头#说明#
##============================= =================== ==========================#
|的X RateLimit限价|每天请求限制/每5分钟|
+ ----------------------------- + ------------------- -------------------------- +
|的X RateLimit,剩余|剩下的请求数的时间|
| |窗口|
+ ----------------------------- + ------------------- -------------------------- +
|的X RateLimit复位|限速之前剩余的窗口|
| |在复位UTC纪元秒|
+ ----------------------------- + ------------------- -------------------------- +
Twitter的REST API速率限制<一个href=\"https://dev.twitter.com/docs/rate-limiting/1.1\">https://dev.twitter.com/docs/rate-limiting/1.1
的注意:的Twitter使用像Vimeo的类似名称的头,但是在每个名称的另一个破折号
块引用>##============================= ======= ======================================#
#HTTP头#说明#
##============================= =================== ==========================#
|的X限速限|限速上限,鉴于|
| |请求|
+ ----------------------------- + ------------------- -------------------------- +
|的X限速,剩余|剩下的请求数为|
| | 15分钟窗口|
+ ----------------------------- + ------------------- -------------------------- +
|的X限速复位|限速之前剩余的窗口|
| |在复位UTC纪元秒|
+ ----------------------------- + ------------------- -------------------------- +Imgur API速率限制 http://api.imgur.com/
##============================= ======= ======================================#
#HTTP头#说明#
##============================= =================== ==========================#
|的X RateLimit-UserLimit |总币可分配|
+ ----------------------------- + ------------------- -------------------------- +
|的X RateLimit-UserRemaining |可用的总学分|
+ ----------------------------- + ------------------- -------------------------- +
|的X RateLimit-UserReset |时间戳(Unix纪元)的学分当|
| |将被复位|
+ ----------------------------- + ------------------- -------------------------- +
|的X RateLimit-ClientLimit |总币可以为被分配|
| |应用程序在一天|
+ ----------------------------- + ------------------- -------------------------- +
|的X RateLimit-ClientRemaining |剩下的应用程序总学分|
| |在一天|
+ ----------------------------- + ------------------- -------------------------- +One of the Additional HTTP Status Codes (RFC6585) is
Where can I find examples of HTTP / REST API Rate-Limiting HTTP response headers that are useful with this HTTP response status?
解决方案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 # #=============================#=============================================# | X-RateLimit-Limit | Request limit per hour | +-----------------------------+---------------------------------------------+ | X-RateLimit-Remaining | The number of requests left for the time | | | window | +-----------------------------+---------------------------------------------+
Vimeo Rate Limiting 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 Rate Limiting 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 Rate Limits 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速率的例子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文