Is it possible to implement X-HTTP-Method-Override in ASP.NET MVC?

后端 未结 8 1704
遥遥无期
遥遥无期 2020-12-18 08:02

I\'m implementing a prototype of a RESTful API using ASP.NET MVC and apart from the odd bug here and there I\'ve achieve all the requirements I set out at the start, apart f

相关标签:
8条回答
  • 2020-12-18 08:57

    Insert to Form:

    <%= Html.HttpMethodOverride(HttpVerbs.Delete) %>
    
    0 讨论(0)
  • 2020-12-18 08:58

    The X-HTTP-Method-Override is a custom header and most likely isn't supported by your web container.

    Are you calling this from a web page? If so, you should probably use XmlHttpRequest with DELETE (or whatever verb you want). Better yet, use a JS framework to do the heavy lifting for you.

    0 讨论(0)
提交回复
热议问题