在 HTTP 协议中,响应状态码 412 Precondition Failed(先决条件失败)表示客户端错误,意味着对于目标资源的访问请求被拒绝。这通常发生于采用除 GET
和 HEAD
之外的方法进行条件请求时,由首部字段 If-Unmodified-Since
或 If-None-Match
规定的先决条件不成立的情况下。这时候,请求的操作——通常是上传或修改文件——无法执行,从而返回该错误状态码。
状态码
412 Precondition Failed(先决条件失败)
规范
浏览器兼容性
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|
Basic Support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
Feature | Android | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|
Basic Support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
参见
文档标签和贡献者