Asp.NET Web API - 405 - 不允许用于访问此页面的 HTTP 动词 - 如何设置处理程序映射 [英] Asp.NET Web API - 405 - HTTP verb used to access this page is not allowed - how to set handler mappings
问题描述
我使用 ASP.NET Web API 编写了 REST 服务.我正在尝试发送 HttpDelete 请求,但出现以下错误:
I wrote REST service using ASP.NET Web API. I'm trying to send HttpDelete request, however I get the following error:
405 - 不允许用于访问此页面的 HTTP 动词
405 - HTTP verb used to access this page is not allowed
我想我已经接近解决方案了,我发现我应该启用 IIS 远程管理,转到处理程序映射部分并将 DELETE 动词添加到适当的位置...但问题是名单上有很多不同的职位......(比如这里:http://www.somacon.com/p126.php).
I think I'm close to the solution, I found out that I should enable IIS remote management , go to Handler Mappings section and add DELETE verb to the appropriate position... but the problem is that there is a lots of different positions on the list... (sth like here: http://www.somacon.com/p126.php).
我应该编辑哪一个?他们中很少有人没有扩展名,例如ExtensionUrlHandler-Integrated-4.0",我向它添加了 DELETE 动词,但它仍然不起作用......
Which one should I edit? Few of them don't have extension, e.g. "ExtensionUrlHandler-Integrated-4.0" and I added DELETE verb to it, but it still doesn't work...
修改那个只是摸不着头脑,所以我应该修改不同的位置吗?如果有,是哪一个?或者还有什么我应该做的吗?
It was just a shot in the dark to modify that one, so should I modify different position? If so, which one? Or maybe is there anything more what I should do?
相同的 Web 服务在我的本地服务上运行良好,所以我猜问题出在远程 IIS 上...
The same web service work perfectly fine on my local service, so I guess the problem is with the remote IIS...
问候
推荐答案
此错误的常见原因是 WebDAV.确保卸载它.
Common cause for this error is WebDAV. Make sure you uninstall it.
这篇关于Asp.NET Web API - 405 - 不允许用于访问此页面的 HTTP 动词 - 如何设置处理程序映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!