Fixing HTTP Error 405 Method Not Allowed

On an IIS hosted site I was receiving HTTP 405 error when I tried to access an API call with a PUT method.

Looking at the details page of the error, it was complaining about WebDAV not permitting the PUT verb.

At first, I just tried adding PUT in the default website’s Handler Mappings, doing an iisreset and trying the API call again. This gave me the same error.

So, I decided to remove the WebDAV module from IIS with the “Add and Remove Features” tool. This gave me a new error:

HTTP Error 500.21: Handler “WebDAV” has a bad module “WebDAVModule” in its module list. Going back to IIS, I removed WebDAV completely from the Handler Mappings, did an iisreset and the site started working.