Asp.Net, API, MVC, PUT / DELETE reported 405 wrong solution

Local put / delete work fine, but the servers that they reported webapi method not allowed 405 errors

The solution is to add the following settings in Web.config inside:

 <system.webServer> 
  <modules> 
    <remove name="WebDAVModule" /> 
  </modules> 
  <handlers> 
    <remove name="WebDAV" /> 
  </handlers> 
</system.webServer>

WebDAV is a Hypertext Transfer Protocol (HTTP) is a set of extensions to provide a standard for editing and file management between computers on the Internet. Using this protocol users can perform basic remote file operations through the Web, such as copy, move, delete, etc. . In IIS 7.0, WebDAV extension as separate modules need to be downloaded separately, and will integrate the WebDAV IIS 7.5, but the WebDav Put, Delete to Kacha. Therefore deployed on IIS 7.5 RESTful services (WCF Data Service, WCF Rest Service, ASP.NET Web API, ASP.NET MVC) on the tragedy, when the request will be sent Put HTTP Error 405.0 happen - Method Not Allowed error, resolve The method is very simple, as the top source solutions.

Guess you like

Origin www.cnblogs.com/SummerYue/p/IIS.html