GitHub的限速消息中剩余时间值的单位是什么?
What are the units for the time remaining value in GitHub's rate limiting message?
根据 GitHub's API documentation,当您超过速率限制时,您会收到如下所示的响应:
HTTP/1.1 403 Forbidden
Date: Tue, 20 Aug 2013 14:50:41 GMT
Status: 403 Forbidden
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1377013266
{
"message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
"documentation_url": "https://developer.github.com/v3/#rate-limiting"
}
X-RateLimit-Reset
值的单位是什么?换句话说,我如何从错误消息中判断我需要等待多长时间(以秒或分钟为单位)才能发送另一个请求?
这是一个 Unix 时间戳,参见 this note from the GitHub API documentation。
使用该示例中的时间戳,重置时间应该是 2013 年 8 月 20 日 15:41:06。
根据 Wikipedia article the GitHub docs link to,Unix 时间戳是:
defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970, not counting leap seconds.
根据 GitHub's API documentation,当您超过速率限制时,您会收到如下所示的响应:
HTTP/1.1 403 Forbidden
Date: Tue, 20 Aug 2013 14:50:41 GMT
Status: 403 Forbidden
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1377013266
{
"message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
"documentation_url": "https://developer.github.com/v3/#rate-limiting"
}
X-RateLimit-Reset
值的单位是什么?换句话说,我如何从错误消息中判断我需要等待多长时间(以秒或分钟为单位)才能发送另一个请求?
这是一个 Unix 时间戳,参见 this note from the GitHub API documentation。
使用该示例中的时间戳,重置时间应该是 2013 年 8 月 20 日 15:41:06。
根据 Wikipedia article the GitHub docs link to,Unix 时间戳是:
defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970, not counting leap seconds.