aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/http/status/412/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/http/status/412/index.html')
-rw-r--r--files/zh-cn/web/http/status/412/index.html47
1 files changed, 47 insertions, 0 deletions
diff --git a/files/zh-cn/web/http/status/412/index.html b/files/zh-cn/web/http/status/412/index.html
new file mode 100644
index 0000000000..c06e8824e9
--- /dev/null
+++ b/files/zh-cn/web/http/status/412/index.html
@@ -0,0 +1,47 @@
+---
+title: 412 Precondition Failed
+slug: Web/HTTP/Status/412
+tags:
+ - Error
+ - HTTP
+ - 参考
+ - 状态码
+translation_of: Web/HTTP/Status/412
+---
+<div>{{HTTPSidebar}}</div>
+
+<p>在 HTTP 协议中,响应状态码 <strong>412 Precondition Failed</strong>(先决条件失败)表示客户端错误,意味着对于目标资源的访问请求被拒绝。这通常发生于采用除 {{HTTPMethod("GET")}} 和 {{HTTPMethod("HEAD")}} 之外的方法进行条件请求时,由首部字段 {{HTTPHeader("If-Unmodified-Since")}} 或 {{HTTPHeader("If-None-Match")}} 规定的先决条件不成立的情况下。这时候,请求的操作——通常是上传或修改文件——无法执行,从而返回该错误状态码。</p>
+
+<h2 id="状态码">状态码</h2>
+
+<pre class="syntaxbox">412 Precondition Failed</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Title</th>
+ </tr>
+ <tr>
+ <td>{{RFC("7232", "412 Precondition Failed" , "4.2")}}</td>
+ <td>Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</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.412")}}</p>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li>{{HTTPStatus("304")}}</li>
+ <li>{{HTTPHeader("If-Unmodified-Since")}}</li>
+ <li>{{HTTPHeader("If-None-Match")}}</li>
+ <li>{{HTTPStatus("428")}}</li>
+</ul>