405 Method Not Allowed error with PUT or DELETE Request on ASP.Net application

If your application uses .NET WebAPI, you may get a 405 Method Not Allowed error when you issue a PUT or DELETE request.
 
This error is caused because the WebDAV module intercepted the request.
 
To work around the issue, you can insert the following in the web.config file in the root directory of your site:
 
<system.webServer>    
  <modules>        
    <remove name="WebDAVModule" />    
  </modules>    
  <handlers>        
    <remove name="WebDAV" />    
  </handlers>
</system.webServer>
 
Note that once you apply this setting, WebDAV will no longer work.