{"id":47060,"date":"2024-10-07T11:06:42","date_gmt":"2024-10-07T03:06:42","guid":{"rendered":"https:\/\/server.hk\/cnblog\/47060\/"},"modified":"2024-10-07T11:06:42","modified_gmt":"2024-10-07T03:06:42","slug":"iis%e7%8b%80%e6%85%8b%e7%a2%bc-412-precondition-failed%ef%bc%88%e5%89%8d%e6%8f%90%e6%a2%9d%e4%bb%b6%e5%a4%b1%e6%95%97%ef%bc%89","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/47060\/","title":{"rendered":"IIS\u72c0\u614b\u78bc &#8211; 412 Precondition Failed\uff08\u524d\u63d0\u689d\u4ef6\u5931\u6557\uff09"},"content":{"rendered":"<h1 id=\"iis%e7%8b%80%e6%85%8b%e7%a2%bc-412-precondition-failed%ef%bc%88%e5%89%8d%e6%8f%90%e6%a2%9d%e4%bb%b6%e5%a4%b1%e6%95%97%ef%bc%89-QPVlrNeksS\">IIS\u72c0\u614b\u78bc &#8211; 412 Precondition Failed\uff08\u524d\u63d0\u689d\u4ef6\u5931\u6557\uff09<\/h1>\n<p>\u5728\u7db2\u7d61\u61c9\u7528\u7a0b\u5e8f\u7684\u958b\u767c\u548c\u7dad\u8b77\u904e\u7a0b\u4e2d\uff0cHTTP\u72c0\u614b\u78bc\u626e\u6f14\u8457\u81f3\u95dc\u91cd\u8981\u7684\u89d2\u8272\u3002\u9019\u4e9b\u72c0\u614b\u78bc\u4e0d\u50c5\u5e6b\u52a9\u958b\u767c\u8005\u7406\u89e3\u8acb\u6c42\u7684\u7d50\u679c\uff0c\u9084\u80fd\u6307\u5c0e\u7528\u6236\u5982\u4f55\u9032\u4e00\u6b65\u64cd\u4f5c\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0eIIS\u72c0\u614b\u78bc412 Precondition Failed\uff08\u524d\u63d0\u689d\u4ef6\u5931\u6557\uff09\uff0c\u4e26\u5206\u6790\u5176\u6210\u56e0\u53ca\u89e3\u6c7a\u65b9\u6848\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af412-precondition-failed%ef%bc%9f-QPVlrNeksS\">\u4ec0\u9ebc\u662f412 Precondition Failed\uff1f<\/h2>\n<p>HTTP\u72c0\u614b\u78bc412\u8868\u793a\u300c\u524d\u63d0\u689d\u4ef6\u5931\u6557\u300d\uff0c\u9019\u901a\u5e38\u767c\u751f\u5728\u5ba2\u6236\u7aef\u767c\u9001\u7684\u8acb\u6c42\u4e2d\u5305\u542b\u4e86\u67d0\u4e9b\u524d\u63d0\u689d\u4ef6\uff0c\u800c\u9019\u4e9b\u689d\u4ef6\u672a\u80fd\u6eff\u8db3\u3002\u9019\u4e9b\u524d\u63d0\u689d\u4ef6\u901a\u5e38\u662f\u901a\u904eHTTP\u8acb\u6c42\u6a19\u982d\u4e2d\u7684\u300cIf-None-Match\u300d\u6216\u300cIf-Modified-Since\u300d\u7b49\u5b57\u6bb5\u4f86\u6307\u5b9a\u7684\u3002<\/p>\n<h2 id=\"412%e7%8b%80%e6%85%8b%e7%a2%bc%e7%9a%84%e6%88%90%e5%9b%a0-QPVlrNeksS\">412\u72c0\u614b\u78bc\u7684\u6210\u56e0<\/h2>\n<p>\u7576\u5ba2\u6236\u7aef\u767c\u9001\u8acb\u6c42\u6642\uff0c\u53ef\u80fd\u6703\u9644\u5e36\u4e00\u4e9b\u689d\u4ef6\uff0c\u9019\u4e9b\u689d\u4ef6\u7528\u65bc\u78ba\u4fdd\u4f3a\u670d\u5668\u7684\u56de\u61c9\u7b26\u5408\u5ba2\u6236\u7aef\u7684\u671f\u671b\u3002\u4f8b\u5982\uff0c\u5ba2\u6236\u7aef\u53ef\u80fd\u5e0c\u671b\u7372\u53d6\u67d0\u500b\u8cc7\u6e90\u7684\u6700\u65b0\u7248\u672c\uff0c\u4f46\u50c5\u5728\u8a72\u8cc7\u6e90\u81ea\u4e0a\u6b21\u8acb\u6c42\u4ee5\u4f86\u5df2\u7d93\u88ab\u4fee\u6539\u7684\u60c5\u6cc1\u4e0b\u3002\u82e5\u4f3a\u670d\u5668\u6aa2\u67e5\u5f8c\u767c\u73fe\u8a72\u8cc7\u6e90\u672a\u88ab\u4fee\u6539\uff0c\u5247\u6703\u8fd4\u56de412\u72c0\u614b\u78bc\uff0c\u8868\u793a\u524d\u63d0\u689d\u4ef6\u672a\u6eff\u8db3\u3002<\/p>\n<h3 id=\"%e5%b8%b8%e8%a6%8b%e7%9a%84%e5%89%8d%e6%8f%90%e6%a2%9d%e4%bb%b6-QPVlrNeksS\">\u5e38\u898b\u7684\u524d\u63d0\u689d\u4ef6<\/h3>\n<ul>\n<li><strong>If-None-Match\uff1a<\/strong>\u6b64\u6a19\u982d\u7528\u65bc\u6aa2\u67e5\u8cc7\u6e90\u7684ETag\uff08\u5be6\u9ad4\u6a19\u7c64\uff09\u3002\u5982\u679c\u8cc7\u6e90\u7684ETag\u8207\u5ba2\u6236\u7aef\u63d0\u4f9b\u7684ETag\u5339\u914d\uff0c\u5247\u4f3a\u670d\u5668\u5c07\u4e0d\u6703\u8fd4\u56de\u8cc7\u6e90\uff0c\u4e26\u8fd4\u56de412\u72c0\u614b\u78bc\u3002<\/li>\n<li><strong>If-Modified-Since\uff1a<\/strong>\u6b64\u6a19\u982d\u7528\u65bc\u6aa2\u67e5\u8cc7\u6e90\u7684\u6700\u5f8c\u4fee\u6539\u6642\u9593\u3002\u5982\u679c\u8cc7\u6e90\u81ea\u6307\u5b9a\u7684\u6642\u9593\u4ee5\u4f86\u672a\u88ab\u4fee\u6539\uff0c\u4f3a\u670d\u5668\u5c07\u8fd4\u56de412\u72c0\u614b\u78bc\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e8%99%95%e7%90%86412%e7%8b%80%e6%85%8b%e7%a2%bc-QPVlrNeksS\">\u5982\u4f55\u8655\u7406412\u72c0\u614b\u78bc<\/h2>\n<p>\u7576\u958b\u767c\u8005\u9047\u5230412\u72c0\u614b\u78bc\u6642\uff0c\u53ef\u4ee5\u63a1\u53d6\u4ee5\u4e0b\u5e7e\u500b\u6b65\u9a5f\u4f86\u9032\u884c\u6545\u969c\u6392\u9664\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5%e8%ab%8b%e6%b1%82%e6%a8%99%e9%a0%ad-QPVlrNeksS\">1. \u6aa2\u67e5\u8acb\u6c42\u6a19\u982d<\/h3>\n<p>\u9996\u5148\uff0c\u6aa2\u67e5\u5ba2\u6236\u7aef\u767c\u9001\u7684\u8acb\u6c42\u6a19\u982d\uff0c\u78ba\u4fdd\u300cIf-None-Match\u300d\u548c\u300cIf-Modified-Since\u300d\u7684\u503c\u6b63\u78ba\u7121\u8aa4\u3002\u9019\u4e9b\u503c\u61c9\u8a72\u8207\u4f3a\u670d\u5668\u4e0a\u8cc7\u6e90\u7684\u7576\u524d\u72c0\u614b\u76f8\u5339\u914d\u3002<\/p>\n<h3 id=\"2-%e7%a2%ba%e8%aa%8d%e8%b3%87%e6%ba%90%e7%8b%80%e6%85%8b-QPVlrNeksS\">2. \u78ba\u8a8d\u8cc7\u6e90\u72c0\u614b<\/h3>\n<p>\u6aa2\u67e5\u4f3a\u670d\u5668\u4e0a\u8a72\u8cc7\u6e90\u7684ETag\u548c\u6700\u5f8c\u4fee\u6539\u6642\u9593\uff0c\u78ba\u4fdd\u5b83\u5011\u8207\u5ba2\u6236\u7aef\u7684\u8acb\u6c42\u76f8\u7b26\u3002\u5982\u679c\u8cc7\u6e90\u5df2\u88ab\u4fee\u6539\uff0c\u5247\u61c9\u66f4\u65b0ETag\u6216\u6700\u5f8c\u4fee\u6539\u6642\u9593\u3002<\/p>\n<h3 id=\"3-%e8%aa%bf%e6%95%b4%e5%ae%a2%e6%88%b6%e7%ab%af%e9%82%8f%e8%bc%af-QPVlrNeksS\">3. \u8abf\u6574\u5ba2\u6236\u7aef\u908f\u8f2f<\/h3>\n<p>\u5982\u679c\u5ba2\u6236\u7aef\u7684\u908f\u8f2f\u4e0d\u6b63\u78ba\uff0c\u53ef\u80fd\u9700\u8981\u8abf\u6574\u5176\u8acb\u6c42\u908f\u8f2f\uff0c\u4ee5\u78ba\u4fdd\u5728\u767c\u9001\u8acb\u6c42\u6642\u4e0d\u6703\u9644\u5e36\u4e0d\u5fc5\u8981\u7684\u524d\u63d0\u689d\u4ef6\u3002<\/p>\n<h2 id=\"%e5%af%a6%e9%9a%9b%e7%af%84%e4%be%8b-QPVlrNeksS\">\u5be6\u969b\u7bc4\u4f8b<\/h2>\n<pre><code>GET \/example\/resource HTTP\/1.1\nHost: www.example.com\nIf-None-Match: \"12345\"\nIf-Modified-Since: Wed, 21 Oct 2015 07:28:00 GMT\n<\/code><\/pre>\n<p>\u5728\u4e0a\u8ff0\u8acb\u6c42\u4e2d\uff0c\u5ba2\u6236\u7aef\u5e0c\u671b\u7372\u53d6\u8cc7\u6e90\uff0c\u4f46\u50c5\u5728\u8a72\u8cc7\u6e90\u7684ETag\u4e0d\u7b49\u65bc&#8221;12345&#8243;\u6216\u81ea\u6307\u5b9a\u7684\u6642\u9593\u4ee5\u4f86\u5df2\u88ab\u4fee\u6539\u7684\u60c5\u6cc1\u4e0b\u3002\u5982\u679c\u4f3a\u670d\u5668\u6aa2\u67e5\u5f8c\u767c\u73feETag\u4ecd\u7136\u662f&#8221;12345&#8243;\uff0c\u5247\u6703\u8fd4\u56de412\u72c0\u614b\u78bc\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-QPVlrNeksS\">\u7e3d\u7d50<\/h2>\n<p>IIS\u72c0\u614b\u78bc412 Precondition Failed\u662fHTTP\u5354\u8b70\u4e2d\u7684\u4e00\u500b\u91cd\u8981\u72c0\u614b\u78bc\uff0c\u5e6b\u52a9\u958b\u767c\u8005\u7406\u89e3\u8acb\u6c42\u7684\u7d50\u679c\u53ca\u5176\u80cc\u5f8c\u7684\u539f\u56e0\u3002\u901a\u904e\u6b63\u78ba\u8655\u7406\u8acb\u6c42\u6a19\u982d\u548c\u8cc7\u6e90\u72c0\u614b\uff0c\u958b\u767c\u8005\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u6b64\u554f\u984c\uff0c\u5f9e\u800c\u63d0\u5347\u7528\u6236\u9ad4\u9a57\u3002\u5c0d\u65bc\u9700\u8981\u7a69\u5b9a\u548c\u9ad8\u6548\u7684\u7db2\u7d61\u61c9\u7528\u7a0b\u5e8f\u7684\u958b\u767c\u8005\u4f86\u8aaa\uff0c\u9078\u64c7\u5408\u9069\u7684\u4f3a\u670d\u5668\u67b6\u69cb\u81f3\u95dc\u91cd\u8981\u3002\u82e5\u60a8\u5c0d\u65bc<em><a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a><\/em>\u6216\u5176\u4ed6\u4f3a\u670d\u5668\u89e3\u6c7a\u65b9\u6848\u6709\u8208\u8da3\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u4ee5\u7372\u53d6\u66f4\u591a\u8cc7\u8a0a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3IIS\u72c0\u614b\u78bc412 Precondition Failed\u7684\u542b\u7fa9\u53ca\u5176\u5f71\u97ff\uff0c\u5e6b\u52a9\u60a8\u89e3\u6c7aHTTP\u8acb\u6c42\u4e2d\u7684\u524d\u63d0\u689d\u4ef6\u554f\u984c\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-47060","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47060","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=47060"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47060\/revisions"}],"predecessor-version":[{"id":47061,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47060\/revisions\/47061"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=47060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=47060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=47060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}