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 |