414 URI Too Long

HTTP 414 URI Too Long 客户端错误响应状态码表示客户端请求的 URI 长度超出了服务器愿意解释的范围。

在以下几种罕见情况下可能会发生此错误:

  • 客户端不恰当地将 POST 请求转换为带有长查询信息的 GET 请求,
  • 客户端陷入重定向循环(例如,重定向的 URI 前缀指向其自身的后缀),或者
  • 服务器受到客户端的攻击,该客户端试图利用潜在的安全漏洞。

有些系统将 414 URI Too Long 实现为 414 Request-URI Too Large

状态

http
414 URI Too Long

示例

使用 GET 提交表单

在以下示例中,HTML <form> 方法意外地使用了 get 而不是 post。大量的表单数据被附加到表单 action 属性中指定的 URL,并作为 GET 请求发送。

http
GET /search?feedback=it+was+the+best+of+times+it+was+the+worst+of+times… HTTP/1.1
Host: example.com

此请求达到了特定服务器的 URI 长度限制,并作为响应发送了 414。

http
HTTP/1.1 414 URI Too Long
Content-Type: text/html; charset=UTF-8
Date: Fri, 28 Jun 2024 11:40:58 GMT
Content-Length: 1234

<!doctype html>
<head>
  <title>414 - URI Too Long</title>
</head>
  <body>
    <h1>414 - URI Too Long</h1>
    <p>The URI provided was too long for the server to process.</p>
  </body>
</html>

规范

规范
HTTP 语义
# status.414

另见