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

另见