511 Network Authentication Required
HTTP 511 需要網路認證 伺服器錯誤響應狀態碼錶明客戶端需要進行身份驗證才能獲得網路訪問許可權。此狀態並非由源伺服器生成,而是由控制網路訪問的攔截 代理 生成。
網路運營商有時會要求進行身份驗證、接受條款或其他使用者互動,然後才授予訪問許可權(例如在網咖或機場)。他們通常透過媒體訪問控制(MAC)地址來識別尚未這樣做的客戶端。
狀態
http
511 Network Authentication Required
示例
GET 請求的 511 響應
在以下示例中,客戶端嘗試訪問網路上的資源。請求未經過身份驗證,代理傳送 511 狀態碼以提示訪問者登入。511 確保非瀏覽器客戶端不會將響應解釋為來自源伺服器。瀏覽器將透過 <meta> 標籤在 10 秒後自動重定向,或透過單擊響應正文中的連結進行重定向。
http
GET /document HTTP/1.1
Host: example.com
http
HTTP/1.1 511 Network Authentication Required
Content-Type: text/html
<html lang="en-US">
<head>
<title>Network Authentication Required</title>
<meta http-equiv="refresh" content="10; url=https://login.example.net/">
</head>
<body>
<p>You need to <a href="https://login.example.net/">authenticate with the local network</a> in order to gain access.</p>
</body>
</html>
規範
| 規範 |
|---|
| RFC 6585 # section-6 |