From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/http/status/401/index.html | 59 ++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 files/zh-cn/web/http/status/401/index.html (limited to 'files/zh-cn/web/http/status/401/index.html') diff --git a/files/zh-cn/web/http/status/401/index.html b/files/zh-cn/web/http/status/401/index.html new file mode 100644 index 0000000000..eb7726d0b2 --- /dev/null +++ b/files/zh-cn/web/http/status/401/index.html @@ -0,0 +1,59 @@ +--- +title: 401 Unauthorized +slug: Web/HTTP/Status/401 +tags: + - 客户端错误 + - 状态码 + - 身份验证 + - 身份验证凭证 +translation_of: Web/HTTP/Status/401 +--- +
{{HTTPSidebar}}
+ +

状态码 401 Unauthorized 代表客户端错误,指的是由于缺乏目标资源要求的身份验证凭证,发送的请求未得到满足。

+ +

这个状态码会与   {{HTTPHeader("WWW-Authenticate")}} 首部一起发送,其中包含有如何进行验证的信息。

+ +

这个状态类似于 {{HTTPStatus("403")}}, 但是在该情况下,依然可以进行身份验证。

+ +

状态

+ +
401 Unauthorized
+ +

响应示例

+ +
HTTP/1.1 401 Unauthorized
+Date: Wed, 21 Oct 2015 07:28:00 GMT
+WWW-Authenticate: Basic realm="Access to staging site"
+ +

规范

+ + + + + + + + + + + + +
SpecificationTitle
{{RFC("7235", "401 Unauthorized" , "3.1")}}HTTP/1.1: Authentication
+ +

浏览器兼容性

+ + + +

{{Compat("http.status.401")}}

+ +

相关内容

+ + -- cgit v1.2.3-54-g00ecf