405 – http verb used to access this page is not allowed windows 2016
405 – http verb used to access this page is not allowed windows 2016 is an error I encountered while I was deploying an API. API development is a popular way to integrate external application with your enterprise software. The only thing you need to do is to develop the API and make it available for others to use. Every API has multiple methods which are required to perform any required operation. The set of common methods for HTTP/1.1 is defined which is given in the link below and this set can be expanded based on requirements.
A high level list of methods is given as under:
|1||GETThe GET method is used to retrieve information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data.|
|2||HEADSame as GET, but transfers the status line and header section only.|
|3||POSTA POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms.|
|4||PUTReplaces all current representations of the target resource with the uploaded content.|
|5||DELETERemoves all current representations of the target resource given by a URI.|
|6||CONNECTEstablishes a tunnel to the server identified by a given URI.|
|7||OPTIONSDescribes the communication options for the target resource.|
|8||TRACEPerforms a message loop-back test along the path to the target resource.|
Get and Post are most commonly used HTTP methods and are allowed by default in IIS. What if you meed to allow other methods, for that you need to allow them. IIS server has different extensions available to perform these tasks and webdav is one of them to allow these modules. I tried to allow these methods but nothing was working and I was getting the error “405 – http verb used to access this page is not allowed windows 2016” which is a bit strange. To overcome this issue on my Windows Server 2016 Server with IIS10, I followed under listed instructions.
Open IIS server Manager
1. Open WebDav Authoring Rules and then select Disable WebDAV option present on the right bar.
2. Select Modules, find the WebDAV Module and remove it.
3. Select HandlerMapping, find the WebDAVHandler and remove it.
Make sure you know what you are doing so that you are not making your system vulnerable and allowing the hackers to take control of your application.