IIS 7 & IIS 8
Configuration & Scripting
How to enable PUT and DELETE verbs on IIS 7
Last post Sep 08, 2012 02:37 AM by kgolding
Mar 19, 2010 05:43 AM|LINK
I am completely a newbie in working with IIS and so I don't know even that I am writing this post in the correct section of the forum or not.
I have just seen the video by Henrik Frystyk Nielsen from PDC 09 on developing Rest Applications with .Net framework.
So I have just created a new project with downloading "WCF REST Service Application" template.
Using this template, there are already couple of auto generated methods which are using PUT and DELETE verbs which are not working for me.
I am using Fiddler to create request over IIS 7.
Through fiddler GET and POST verbs are working fine but when i use the PUT or DELETE one it shows the error 405 "Method not Allowed".
I am working on Windows 7 Ultimate 64 bit and it uses IIS 7 (which is by default I suppose, I have just enable the IIS from "Add or Remove Programs").
I have tried to enable them from "Request Filtering", but that is not working.
So anyone please let me know how to enable PUT and DELETE verbs in IIS 7.
Nikhil Thaker (MCTS - ASP.NET 3.5)
Verbs in IIS
Mar 19, 2010 06:26 AM|LINK
Here is a few troubleshoot.
1. Make sure REST service application's handler is in <handlers/> section and it is supposed to set to accept PUT and DELETE verbs.
2. Enable Failed Request Tracing and check who throws 405.
3. In case WebDAV is installed, you should 1) uninstall it from the box to use RESTfull service, or 2) remove WebDAVModule from <modules/> in site.
Let me know whether it helps.
Mar 19, 2010 10:56 AM|LINK
Here are the images of Http error in Fiddler with DELETE verb and my web.config file.
1.> Http error in fiddler
2.> My application's web.config
It would be good if you can help with these images.
Mar 19, 2010 10:20 PM|LINK
Yes, 1) indicates WebDAV module throws 405. You should uninstall it in order to use RESTFull.
Unfortunetly, they share common http verb and similar protocol.
The reason why WebDAV throws 405 is that it claims to process the request, but site is not configured to process it.
Jun 29, 2010 09:35 AM|LINK
I have a similar problem, but Webdav is not installed.
My error is "401 - Unauthorized: Access is denied due to invalid credentials. + You do not have permission to view this directory or page using the credentials that you supplied"
This happen ONLY on DELETE & PUT verbs, GET etc is working fine.
I use IIS7 on Windows 2008 server, my application is in the Asp.Net V4.0 (integrated) pool.
On the default web site level and application level, all the default handlers for *svc listed allow "all verbs".
I'm unsure which handler is the correct one (I assume "svc-Integrated-4.0" that use type "System.ServiceModel.Activation.ServiceHttpHandlerFactory"?), so tested all listed anyway.
If I set a handler not to use all verbs and enter them manually, I can see the "<handlers>" section appear in the applications web.config and settings look ok.
I tested the requestFiltering settings as well and were able to allow/disallow GET verbs, but it has no effect on my DELETE verb exception.
Any advice would be much appreciated.
Jun 29, 2010 12:51 PM|LINK
My issue is sorted.
I had to enable form authentication in IIS application level to get PUT/DELETE working. (GET worked before without that)
Strange, but there is no web.config FORM authentication specified. I was under the understanding that Windows is the default mode used when not specified... ?
Mar 03, 2011 09:07 AM|LINK
May 04, 2011 09:05 PM|LINK
Remove WebDav from "Modules" and from "Handler Mappings"
WebDAVModule, %windir%\System32\inetsrv\webdav.dll, Native, Inherited
WebDAV, *, Enabled, Unspecified, WebDAVModule, Inherited
Then Restart IIS
It results in a Web.Config change of:
<remove name="WebDAVModule" />
<remove name="WebDAV" />
Jun 24, 2011 12:50 AM|LINK
Thanks, this fixed my problem and clarified what was going on.
Sep 08, 2012 02:37 AM|LINK
Verbs in IIS