HTTP状态码407

title

HTTP状态码407表示请求需要代理身份验证。此状态代码与401(未经授权)类似,但指定的身份验证是由代理服务器完成的,而不是由请求的资源服务器完成的。在请求中,客户端通常会向代理服务器发送身份验证凭据,以便代理服务器可以使用这些凭据验证客户端的身份。

以下是HTTP 407错误响应的示例:

HTTP/1.1 407 Proxy Authentication Required
Date: Fri, 05 Mar 2021 05:51:44 GMT
Proxy-Authenticate: Basic realm="Access to internal site"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 381

<!DOCTYPE html>
<html>
<head>
    <title>407 Proxy Authentication Required</title>
</head>
<body>
    <h1>Proxy Authentication Required</h1>
    <p>This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.</p>
</body>
</html>

在此示例中,服务器返回HTTP 407错误,并在响应头部中提供了代理身份验证所需的信息。客户端应该使用提供的身份验证凭据进行身份验证,然后重新发送请求。如果身份验证仍然无法通过,则客户端可能无法访问所请求的资源。

powered by Gitbook© 2023 编外计划 | 最后修改: 2023-11-24 03:36:58

results matching ""

    No results matching ""