Home > .NET > MVC 4 Beta + WebApi PUT/DELTE throw 401 on IIS 7.5

MVC 4 Beta + WebApi PUT/DELTE throw 401 on IIS 7.5

Kinda crazy that everything works fine on localhost, however once deployed to UAT, as soon as the Ajax hitting the PUT/DELETE it throw 401 while GET/POST stays working as it should

After some diggings seems it’s to do with WebDAV, you can search for the topic “Allowing PUT and DELETE in IIS 7.5”.

PUT and DELETE are considered as WebDAV verb and webdav module claims the request. basically, webdav cannot be set with other module like RESTFul also handling WebDAV specific verbs. ie. PUT, DELETE, COPY.etc

Disable webdav on site does not resove your concern.
Solution is to uninstall webdav module. If OS is Vista or W2K8, then go to control panel/Add Remove Program, and remove webdav.
If OS is Win7, for server machine, Server Manager -> Role -> Web Server -> Common HTTP Features -> WebDAV Publishing, and for client machine Control Panel -> Uninstall Program -> Turn Windows features on or off -> IIS -> World Wide Web Services -> Common HTTP feautre -> WebDAV Publishing.

Found a post about this http://forums.iis.net/t/1163441.aspx

I will give it a shot tomorrow and prepare for the worst and the fall-back would be POST!

Update:
Yes everything works like a charm! simply by removing WebDAV from IIS 7.5

Categories: .NET Tags: , , , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a comment