ASP.NET中处理PUT / DELETE动词 [英] ASP.NET Handle PUT/DELETE verbs

查看:102
本文介绍了ASP.NET中处理PUT / DELETE动词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这适用于ASP.NET一般也是网络API。

This applies to ASP.NET in general but also Web API.

我们如何处理PUT / DELETE动词的没有启用RAMMFAR(RunAllManagedModulesForAllRequests)。

How can we handle PUT/DELETE verbs without enabling RAMMFAR (RunAllManagedModulesForAllRequests).

我无法配置IIS中的处理程序映射为我的网站上Azure的Web角色和任何更改托管让我不会保留。

I can't configure the handler mapping within IIS as my site is hosted on an Azure Web Role and any changes I make will not be persisted.

推荐答案

@亚历山大的回答让我在​​正确的轨道上。不得不添加下面让DELETE / PUT由ASP.NET处理:

@Alexander's answer put me on the right track. Had to add the following to get DELETE/PUT handled by ASP.NET:

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="false"/>
    <handlers>
      <remove name="ExtensionlessUrl-Integrated-4.0" />
      <add name="ExtensionlessUrl-Integrated-4.0" 
           path="*." 
           verb="GET,HEAD,POST,DEBUG,DELETE,PUT" 
           type="System.Web.Handlers.TransferRequestHandler" 
           preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
  </system.webServer>

这篇关于ASP.NET中处理PUT / DELETE动词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆