4. 429 Too Many Requests
429 status code 表示用户在给定时间内发送了过多请求 ("rate limiting").
response representations SHOULD 包含解释该状况的细节, 并且 MAY 包含 Retry-After header, 指示在发出新请求前需要等待多长时间.
例如:
HTTP/1.1 429 Too Many Requests
Content-Type: text/html
Retry-After: 3600
<html>
<head>
<title>Too Many Requests</title>
</head>
<body>
<h1>Too Many Requests</h1>
<p>I only allow 50 requests per hour to this Web site per
logged in user. Try again soon.</p>
</body>
</html>
注意, 本规范未定义 origin server 如何识别用户, 也未定义它如何计数请求. 例如, 限制请求速率的 origin server 可以基于每个资源的请求计数, 整个服务器范围内的请求计数, 甚至一组服务器之间的请求计数来执行限制. 同样, 它也可以通过用户的 authentication credentials 或 stateful cookie 来识别用户.
带有 429 status code 的响应 MUST NOT 由 cache 存储.