Attribute routing with http PUT method constraint

好久不见. 提交于 2019-12-03 17:17:49

Real HttpPut

This should work, but you have to modify the ExtensionlessUrlHandler to allow additional verbs:

<handlers>
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
    <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>

X-HTTP-Method-Override

This seems to be a bug (or not just implemented) in 5.0. You could try a nightly build of MVC 5.1 Alpha, where X-HTTP-Method-Override gets respected.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!