aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/http/status/401/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/http/status/401/index.html
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/http/status/401/index.html')
-rw-r--r--files/zh-cn/web/http/status/401/index.html59
1 files changed, 59 insertions, 0 deletions
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
+---
+<div>{{HTTPSidebar}}</div>
+
+<p>状态码 <strong><code>401 Unauthorized</code></strong> 代表客户端错误,指的是由于缺乏目标资源要求的身份验证凭证,发送的请求未得到满足。</p>
+
+<p>这个状态码会与   {{HTTPHeader("WWW-Authenticate")}} 首部一起发送,其中包含有如何进行验证的信息。</p>
+
+<p>这个状态类似于 {{HTTPStatus("403")}}, 但是在该情况下,依然可以进行身份验证。</p>
+
+<h2 id="状态">状态</h2>
+
+<pre class="syntaxbox">401 Unauthorized</pre>
+
+<h2 id="响应示例">响应示例</h2>
+
+<pre>HTTP/1.1 401 Unauthorized
+Date: Wed, 21 Oct 2015 07:28:00 GMT
+WWW-Authenticate: Basic realm="Access to staging site"</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Title</th>
+ </tr>
+ <tr>
+ <td>{{RFC("7235", "401 Unauthorized" , "3.1")}}</td>
+ <td>HTTP/1.1: Authentication</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
+
+<p>{{Compat("http.status.401")}}</p>
+
+<h2 id="相关内容">相关内容</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a></li>
+ <li>{{HTTPHeader("WWW-Authenticate")}}</li>
+ <li>{{HTTPHeader("Authorization")}}</li>
+ <li>{{HTTPHeader("Proxy-Authorization")}}</li>
+ <li>{{HTTPHeader("Proxy-Authenticate")}}</li>
+ <li>{{HTTPStatus("403")}}, {{HTTPStatus("407")}}</li>
+</ul>