locked
WebApi v2 Visual Studio 2013 IIS Express HTTP 405 DELETE Method Not Allowed RRS feed

  • Question

  • I am trying to get web api v2 working with IIS Express and Visual Studio 2013. When I try to get the Delete or Put methods to work, it give me an HTTP 405 The requested resource does not support http method 'DELETE'.

    The web.config is allowing these verbs. I have change the applicationHost.config file so that all handlers accept all verbs.

    I scoured the web and implemented every solution that was presented but it still give the same error.

    I have used [RouteAttribute("DELETE")], [HttpDelete], and [AcceptVerbs("DELETE")]. This error is given in both visual studio and fiddler.

    • Moved by Caillen Wednesday, December 18, 2013 8:01 AM ASP.NET or IIS question.
    Tuesday, December 17, 2013 11:01 PM

Answers

  • This may be a silly question but have you allowed DELETE in handler mappings in IIS?  IIS Express doesn't allow PUT or DELETE by default.

    In the "verb" attribute add PUT and DELETE so the "verb" attribute looks like:  You can modify the IIS Express "applicationHost.config" in the %userprofile%\documents\IISExpress\config” folder.  For example to enable PUT and DELETE for extensionless Urls scroll down to the bottom of the IIS Express applicationHost.config file and look for a handler entry that starts with: <add name="ExtensionlessUrl-Integrated-4.0" ... . In the "verb" attribute add PUT and DELETE so the "verb" attribute looks like:  verb="GET,HEAD,POST,DEBUG,PUT,DELETE"

    • Proposed as answer by JayChase Wednesday, December 18, 2013 1:22 AM
    • Marked as answer by Just Karl Monday, January 6, 2014 7:25 PM
    Tuesday, December 17, 2013 11:50 PM
  • Hi travisgerry,

    I recommend that you post your question in the following forums since this is a forum for Visual C# questions:

    ASP.NET forums or IIS forums

    More experts will give you professional responses there.

    Thanks for your understanding.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Just Karl Thursday, December 26, 2013 6:57 PM
    • Marked as answer by Just Karl Monday, January 6, 2014 7:25 PM
    Wednesday, December 18, 2013 8:01 AM

All replies

  • In Fiddler, under Miscellaneous it still says Allow: GET,POST
    Tuesday, December 17, 2013 11:02 PM
  • All Get requests work properly
    Tuesday, December 17, 2013 11:04 PM
  • This may be a silly question but have you allowed DELETE in handler mappings in IIS?  IIS Express doesn't allow PUT or DELETE by default.

    In the "verb" attribute add PUT and DELETE so the "verb" attribute looks like:  You can modify the IIS Express "applicationHost.config" in the %userprofile%\documents\IISExpress\config” folder.  For example to enable PUT and DELETE for extensionless Urls scroll down to the bottom of the IIS Express applicationHost.config file and look for a handler entry that starts with: <add name="ExtensionlessUrl-Integrated-4.0" ... . In the "verb" attribute add PUT and DELETE so the "verb" attribute looks like:  verb="GET,HEAD,POST,DEBUG,PUT,DELETE"

    • Proposed as answer by JayChase Wednesday, December 18, 2013 1:22 AM
    • Marked as answer by Just Karl Monday, January 6, 2014 7:25 PM
    Tuesday, December 17, 2013 11:50 PM
  • Yes. I did that. In fact, just to make sure I changed every verb= to verb="GET,HEAD,POST,DEBUG,PUT,DELETE" just to be sure.
    Wednesday, December 18, 2013 1:42 AM
  • Hi travisgerry,

    I recommend that you post your question in the following forums since this is a forum for Visual C# questions:

    ASP.NET forums or IIS forums

    More experts will give you professional responses there.

    Thanks for your understanding.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Just Karl Thursday, December 26, 2013 6:57 PM
    • Marked as answer by Just Karl Monday, January 6, 2014 7:25 PM
    Wednesday, December 18, 2013 8:01 AM