1
我试图在ASP.NET MVC api。不幸的是我有问题,两个HTTP请求:DELETE和PUTIIS 10.0详细错误 - 404.0为[httpDelete] [httpPut]
[ActionName("Index")]
[HttpGet]
public String Index()
{
return "get";
}
[ActionName("Index")]
[HttpPost]
public String IndexPost()
{
return "create";
}
[ActionName("Index")]
[HttpPut]
public String IndexPut()
{
return "update";
}
[ActionName("Index")]
[HttpDelete]
public String IndexDelete()
{
return "delete";
}
GET,当我试图发送删除或PUT然后浏览器返回POST请求的工作完全正常IIS 10.0详细错误 - 404.0 - 未找到。
<system.webServer>
<modules>
<remove name="WebDAVModule"/>
</modules>
<handlers>
<remove name="WebDAV" />
<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>
确保您已经添加'handlers'到网络配置文件 –
并请,加上'<添加名称=“ExtensionlessUrlHandler ..'部分的web配置文件的问题 –
我找不到'
krychuq