
{"id":2358,"date":"2017-03-27T21:51:18","date_gmt":"2017-03-28T01:51:18","guid":{"rendered":"http:\/\/www.ikriv.com\/blog\/?p=2358"},"modified":"2017-03-27T21:51:35","modified_gmt":"2017-03-28T01:51:35","slug":"how-webdav-prevents-put-requests-from-working","status":"publish","type":"post","link":"https:\/\/ikriv.com\/blog\/?p=2358","title":{"rendered":"How WebDAV prevents PUT requests from working"},"content":{"rendered":"<p>The story in a nutshell: you suddenly start receiving &#8220;405 method not allowed&#8221; response to PUT requests to your ASP.NET web service.<\/p>\n<p>This problem hit us last September, but I did not blog about it then, but today we stepped on it again, so I am practically obligated to put it in the blog.<\/p>\n<p>The culprit is WebDAV. If WebDAV is installed on the server, it becomes the first handler, and intercepts all PUT and DELETE requests, so they don&#8217;t even reach your ASP.NET application. The config file where this info is <code>C:\\Windows\\System32\\inetsrv\\config\\applicationHost.config<\/code>.<\/p>\n<pre>&lt;handlers accessPolicy=\"Read, Script\"&gt;\r\n&lt;add name=\"WebDAV\" path=\"*\" \u00a0\r\n       verb=\"PROPFIND,PROPPATCH,MKCOL,PUT,COPY,DELETE,MOVE,LOCK,UNLOCK\" \r\n       modules=\"WebDAVModule\" \r\n       resourceType=\"Unspecified\" \r\n       requireAccess=\"None\" \/&gt;<\/pre>\n<p>The simplest solution is to uninstall WebDAV. If this cannot be done, one needs to change the <code>path=\"*\"<\/code> part.<br \/>\nSee also: <a href=\"http:\/\/www.asp.net\/web-api\/overview\/testing-and-debugging\/troubleshooting-http-405-errors-after-publishing-web-api-applications\">http:\/\/www.asp.net\/web-api\/overview\/testing-and-debugging\/troubleshooting-http-405-errors-after-publishing-web-api-applications<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The story in a nutshell: you suddenly start receiving &#8220;405 method not allowed&#8221; response to PUT requests to your ASP.NET web service. This problem hit us last September, but I <a href=\"https:\/\/ikriv.com\/blog\/?p=2358\" class=\"more-link\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[1],"tags":[],"class_list":["entry","author-ikriv","post-2358","post","type-post","status-publish","format-standard","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2358"}],"version-history":[{"count":2,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2358\/revisions"}],"predecessor-version":[{"id":2360,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2358\/revisions\/2360"}],"wp:attachment":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}