{"id":229641,"date":"2023-12-25T07:10:17","date_gmt":"2023-12-24T23:10:17","guid":{"rendered":"https:\/\/www.idc.net\/help\/229641\/"},"modified":"2023-12-25T07:10:17","modified_gmt":"2023-12-24T23:10:17","slug":"iis%e7%8a%b6%e6%80%81%e7%a0%81-405-method-not-allowed%ef%bc%88%e6%96%b9%e6%b3%95%e4%b8%8d%e8%a2%ab%e5%85%81%e8%ae%b8%ef%bc%89","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/229641\/","title":{"rendered":"IIS\u72b6\u6001\u7801 &#8211; 405 Method Not Allowed\uff08\u65b9\u6cd5\u4e0d\u88ab\u5141\u8bb8\uff09"},"content":{"rendered":"<p><title id=\"iis%e7%8a%b6%e6%80%81%e7%a0%81-405-method-not-allowed%ef%bc%88%e6%96%b9%e6%b3%95%e4%b8%8d%e8%a2%ab%e5%85%81%e8%ae%b8%ef%bc%89-vGsbdXOSsJ\">IIS\u72b6\u6001\u7801 - 405 Method Not Allowed\uff08\u65b9\u6cd5\u4e0d\u88ab\u5141\u8bb8\uff09<\/title><\/p>\n<h1 id=\"iis%e7%8a%b6%e6%80%81%e7%a0%81-405-method-not-allowed%ef%bc%88%e6%96%b9%e6%b3%95%e4%b8%8d%e8%a2%ab%e5%85%81%e8%ae%b8%ef%bc%89-vGsbdXOSsJ\">IIS\u72b6\u6001\u7801 - 405 Method Not Allowed\uff08\u65b9\u6cd5\u4e0d\u88ab\u5141\u8bb8\uff09<\/h1>\n<p>\u5f53\u60a8\u5728\u6d4f\u89c8\u7f51\u9875\u65f6\uff0c\u6709\u65f6\u53ef\u80fd\u4f1a\u9047\u5230\u201c405 Method Not Allowed\u201d\u9519\u8bef\u3002\u8fd9\u662f\u4e00\u79cd\u5e38\u89c1\u7684IIS\uff08Internet Information Services\uff09\u72b6\u6001\u7801\uff0c\u8868\u793a\u8bf7\u6c42\u7684HTTP\u65b9\u6cd5\u4e0d\u88ab\u670d\u52a1\u5668\u5141\u8bb8\u3002<\/p>\n<h2 id=\"%e4%bb%80%e4%b9%88%e6%98%afhttp%e6%96%b9%e6%b3%95%ef%bc%9f-vGsbdXOSsJ\">\u4ec0\u4e48\u662fHTTP\u65b9\u6cd5\uff1f<\/h2>\n<p>HTTP\uff08Hypertext Transfer Protocol\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u5728Web\u6d4f\u89c8\u5668\u548cWeb\u670d\u52a1\u5668\u4e4b\u95f4\u4f20\u8f93\u6570\u636e\u7684\u534f\u8bae\u3002\u5728HTTP\u4e2d\uff0c\u6709\u591a\u79cd\u65b9\u6cd5\u53ef\u4ee5\u7528\u4e8e\u8bf7\u6c42\u548c\u54cd\u5e94\u6570\u636e\u3002\u5e38\u89c1\u7684HTTP\u65b9\u6cd5\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>GET - \u83b7\u53d6\u8d44\u6e90<\/li>\n<li>POST - \u63d0\u4ea4\u6570\u636e<\/li>\n<li>PUT - \u66f4\u65b0\u8d44\u6e90<\/li>\n<li>DELETE - \u5220\u9664\u8d44\u6e90<\/li>\n<\/ul>\n<h2 id=\"%e4%b8%ba%e4%bb%80%e4%b9%88%e4%bc%9a%e5%87%ba%e7%8e%b0405%e9%94%99%e8%af%af%ef%bc%9f-vGsbdXOSsJ\">\u4e3a\u4ec0\u4e48\u4f1a\u51fa\u73b0405\u9519\u8bef\uff1f<\/h2>\n<p>\u5f53\u60a8\u53d1\u9001\u4e00\u4e2aHTTP\u8bf7\u6c42\u65f6\uff0c\u670d\u52a1\u5668\u4f1a\u68c0\u67e5\u8be5\u8bf7\u6c42\u4f7f\u7528\u7684\u65b9\u6cd5\u662f\u5426\u88ab\u5141\u8bb8\u3002\u5982\u679c\u670d\u52a1\u5668\u4e0d\u652f\u6301\u6216\u4e0d\u5141\u8bb8\u4f7f\u7528\u8be5\u65b9\u6cd5\uff0c\u5c31\u4f1a\u8fd4\u56de405\u9519\u8bef\u3002<\/p>\n<p>\u5e38\u89c1\u7684\u60c5\u51b5\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u4f7f\u7528\u4e86\u9519\u8bef\u7684HTTP\u65b9\u6cd5\uff1a\u4f8b\u5982\uff0c\u5c1d\u8bd5\u4f7f\u7528GET\u65b9\u6cd5\u6765\u63d0\u4ea4\u8868\u5355\u6570\u636e\u3002<\/li>\n<li>\u670d\u52a1\u5668\u914d\u7f6e\u9519\u8bef\uff1a\u670d\u52a1\u5668\u53ef\u80fd\u6ca1\u6709\u6b63\u786e\u914d\u7f6e\u4ee5\u5141\u8bb8\u7279\u5b9a\u7684HTTP\u65b9\u6cd5\u3002<\/li>\n<li>\u6743\u9650\u95ee\u9898\uff1a\u60a8\u53ef\u80fd\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u6765\u6267\u884c\u7279\u5b9a\u7684HTTP\u65b9\u6cd5\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3405%e9%94%99%e8%af%af%ef%bc%9f-vGsbdXOSsJ\">\u5982\u4f55\u89e3\u51b3405\u9519\u8bef\uff1f<\/h2>\n<p>\u8981\u89e3\u51b3405\u9519\u8bef\uff0c\u60a8\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\uff1a<\/p>\n<ol>\n<li>\u68c0\u67e5\u4f7f\u7528\u7684HTTP\u65b9\u6cd5\uff1a\u786e\u4fdd\u60a8\u4f7f\u7528\u7684\u662f\u6b63\u786e\u7684HTTP\u65b9\u6cd5\u3002\u5982\u679c\u60a8\u6b63\u5728\u5c1d\u8bd5\u63d0\u4ea4\u6570\u636e\uff0c\u5e94\u8be5\u4f7f\u7528POST\u65b9\u6cd5\u800c\u4e0d\u662fGET\u65b9\u6cd5\u3002<\/li>\n<li>\u68c0\u67e5\u670d\u52a1\u5668\u914d\u7f6e\uff1a\u786e\u4fdd\u670d\u52a1\u5668\u5df2\u6b63\u786e\u914d\u7f6e\u4ee5\u5141\u8bb8\u6240\u9700\u7684HTTP\u65b9\u6cd5\u3002\u60a8\u53ef\u4ee5\u8054\u7cfb\u670d\u52a1\u5668\u7ba1\u7406\u5458\u6216\u6258\u7ba1\u63d0\u4f9b\u5546\u4ee5\u83b7\u53d6\u5e2e\u52a9\u3002<\/li>\n<li>\u68c0\u67e5\u6743\u9650\uff1a\u5982\u679c\u60a8\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u6267\u884c\u7279\u5b9a\u7684HTTP\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u8054\u7cfb\u670d\u52a1\u5668\u7ba1\u7406\u5458\u6216\u6258\u7ba1\u63d0\u4f9b\u5546\u4ee5\u83b7\u53d6\u6743\u9650\u3002<\/li>\n<\/ol>\n<h2 id=\"%e7%a4%ba%e4%be%8b%e4%bb%a3%e7%a0%81-vGsbdXOSsJ\">\u793a\u4f8b\u4ee3\u7801<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\u4ee3\u7801\uff0c\u6f14\u793a\u5982\u4f55\u4f7f\u7528PHP\u53d1\u9001POST\u8bf7\u6c42\uff1a<\/p>\n<pre><code>\n&lt;?php\n$url = 'https:\/\/www.example.com\/api';\n$data = array('name' =&gt; 'John Doe', 'email' =&gt; 'johndoe@example.com');\n\n$options = array(\n  'http' =&gt; array(\n    'header'  =&gt; \"Content-type: application\/x-www-form-urlencodedrn\",\n    'method'  =&gt; 'POST',\n    'content' =&gt; http_build_query($data),\n  ),\n);\n\n$context  = stream_context_create($options);\n$response = file_get_contents($url, false, $context);\nif ($response === FALSE) { \/* \u5904\u7406\u9519\u8bef *\/ }\n\nvar_dump($response);\n?&gt;\n<\/code><\/pre>\n<h2 id=\"%e6%80%bb%e7%bb%93-vGsbdXOSsJ\">\u603b\u7ed3<\/h2>\n<p>\u5f53\u60a8\u9047\u5230IIS\u72b6\u6001\u7801405 Method Not Allowed\u65f6\uff0c\u8fd9\u610f\u5473\u7740\u60a8\u7684\u8bf7\u6c42\u4f7f\u7528\u4e86\u670d\u52a1\u5668\u4e0d\u5141\u8bb8\u7684HTTP\u65b9\u6cd5\u3002\u8981\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u60a8\u53ef\u4ee5\u68c0\u67e5\u4f7f\u7528\u7684HTTP\u65b9\u6cd5\u3001\u670d\u52a1\u5668\u914d\u7f6e\u548c\u6743\u9650\u3002\u5982\u679c\u60a8\u6b63\u5728\u5bfb\u627e\u53ef\u9760\u7684\u9999\u6e2f\u670d\u52a1\u5668\uff0c\u540e\u6d6a\u4e91\u662f\u60a8\u7684\u9996\u9009\u3002\u60a8\u53ef\u4ee5\u8bbf\u95ee<a href=\"https:\/\/idc.net\">https:\/\/idc.net<\/a>\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u9999\u6e2f\u670d\u52a1\u5668\u3001\u7f8e\u56fd\u670d\u52a1\u5668\u548c\u4e91\u670d\u52a1\u5668\u7684\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IIS\u72b6\u6001\u7801 - 405 Method Not Allowed\uff08\u65b9\u6cd5\u4e0d\u88ab\u5141\u8bb8\uff09 IIS\u72b6\u6001\u7801 - 405 Me [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[],"class_list":["post-229641","post","type-post","status-publish","format-standard","hentry","category-iis"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/229641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=229641"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/229641\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=229641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=229641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=229641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}