Thursday 12 July 2012

Method Not Allowed 405 on IIS7 Website eg PUT, DELETE etc

If you are working with a .net MVC4 WebApi project that needs to provide CRUD capabilities then your the standard Http Methods your site will need to accept are GET, POST, PUT, DELETE.


I had trouble getting my site to accept PUT and DELETE methods when hosting my site locally with IIS7. I am hosting the application under its own website, this lets me change the settings for the particular site using the IIS7 interface. Here are the steps I took to correct the problem:


Begin in IIS7 by highlighting your website, then choosing Handler Mappings from the available options:





Then select WebDAV from the list of Mappings.



Click Request Restrictions.


Then switch to the Verbs tab and highlight All Verbs.


Restart the application in IIS and hey presto! PUT and DELETE enabled (as well as all HTTP methods). If you want to more conservative about which methods are supported then use the option beneath All Verbs.This results in the changes to your Web.config. Inside your <system.web> section goes this snippet: (You don't actually have to add this - IIS7 will have added this itself)

<handlers>
  <remove name="WebDAV" />
  <add name="WebDAV" path="*" verb="*" modules="WebDAVModule" resourceType="Unspecified" requireAccess="None" />
</handlers>

Hope this will help someone out!

P.s. I found WFetch to be quite a useful tool in debugging http requests.







64 comments:

  1. http://betimdrenica.wordpress.com/2013/02/05/web-api-on-iis-8-0-405-method-not-allowed-for-put/

    ReplyDelete
  2. Fixed it for me. Thanks!

    ReplyDelete
  3. Thanks, the screenshots really helped!

    ReplyDelete
  4. Thanks - the screenshots were tremendously useful.

    ReplyDelete
  5. This is not the best way. See here: http://stackoverflow.com/questions/6739124/iis-7-5-enable-put-and-delete-for-restful-service-extensionless

    ReplyDelete
  6. I am very enjoyed for this blog. Its an informative topic. It help me very much to solve some problems. Its opportunity are so fantastic and working style so speedy.
    video and blog marketing

    ReplyDelete
  7. Thank u so much ... I need it :) it works for me after a lot of search.

    ReplyDelete
  8. Great help ! thanks for sharing.

    ReplyDelete
  9. Worked like a charm!! Also pls mention the side effects of doing this change(if any) in IIS production server. How safe it is?

    ReplyDelete
  10. Hi,

    Thanks for sharing a very interesting article about Method Not Allowed 405 on IIS7 Website eg PUT, DELETE etc. This is very useful information for online blog review readers. Keep it up such a nice posting like this.

    Regards,
    WondersMind,
    Web Design Company Bangalore

    ReplyDelete
  11. You are a very good soul! Thank you.

    ReplyDelete
  12. It would be great if you provide some solution for integration google api with php pahe without much effort.

    Flats in sahakr nagar bangalore>

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. Thank you so much sharing this informative blog with us. Visit for shipping and freight forwarders company at Webdots Hubli.
    webdesign in hubli
    seo service in hubli
    webdesign in dharwad
    digital marketing services
    digital marketing classes

    ReplyDelete
  15. We are a SEO Company in Chennai, our SEO experts have good years of experience with tried & tested techniques to rank your website. So, if you are looking for a Best SEM Company in Chennai feel free to contact us.

    ReplyDelete
  16. When I initially commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get four e-mails with the same comment. Is there any way you can remove me from that service? Many thanks!

    ReplyDelete
  17. Pretty component to content. I simply stumbled upon your blog and in accession capital to say that I get in fact enjoyed account your weblog posts. Any way I will be subscribing on your feeds or even I success you access constantly fast.야한동영상

    ReplyDelete
  18. Amazing issues here. I am very glad to see your post. Thanks so much and I’m taking a look forward to contact you.휴게텔

    ReplyDelete
  19. Great blog right here! Additionally your site a lot up very fast! What host are you the use of? Can I am getting your associate hyperlink in your host? I wish my web site loaded up as fast as yours 출장안마

    ReplyDelete
  20. This content is simply exciting and creative. I have been deciding on an institutional move and this has helped me with one aspect. 경마사이트

    ReplyDelete
  21. I know this website presents quality depending articles or reviews and other stuff, is there any other site which gives these kinds of data in quality? 카지노사이트

    ReplyDelete
  22. I like it when people get together and share views. Great website 온라인카지노

    ReplyDelete
  23. It’s really a great and helpful piece of information. I’m glad that you just shared this helpful information with us. Please stay us informed like this. 온라인바둑이

    ReplyDelete
  24. Very rapidly this site will be famous among all blogging visitors, due to it's pleasant articles 파친코사이트

    ReplyDelete
  25. here are some hyperlinks to web sites that we link to since we assume they are worth visiting 토토사이트

    ReplyDelete
  26. It's too bad to check your article late. I wonder what it would be if we met a little faster. I want to exchange a little more, but please visit my site casinocommunity and leave a message!!

    ReplyDelete
  27. Our collection includes both fixed and removable vagina options, ラブドールas well as oral and anal openings to explore

    ReplyDelete
  28. تقدم شركة كلينر خدمات التنظيف في الرياض خدمات متنوعة وعالية الجودة.
    ارخص شركة تنظيف بالرياض

    ReplyDelete
  29. تتميز شركة كلين الرياض في الرياض بتوفير خدمات شاملة
    شركة تنظيف منازل بالرياض

    ReplyDelete
  30. شركة سبيد واي تبرز كواحدة من أبرز الخيارات المتاحة للعملاء الذين يبحثون عن خدمة نقل الاثاث
    نقل عفش بالرياض 200 ريال

    ReplyDelete
  31. شركة النور للتسليك والتنظيف هي شركة متخصصة في تقديم خدمات تسليك المجاري وشفط البيارات
    شركة تسليك مجاري بالضغط بالدمام

    ReplyDelete