“405 方法不允许"在 IIS7.5 中“PUT"方法 [英] "405 method not allowed" in IIS7.5 for "PUT" method
问题描述
我使用 WebClient
类型将 *.cab 文件上传到我的服务器.在服务器端,我使用 PUT 方法为 *.cab 文件注册了一个 HTTP 处理程序,如下所示:
I use WebClient
type to upload *.cab files to my server. On the server side, I registered a HTTP handler for *.cab file with the PUT method as below:
<add name="ResultHandler" path="*.cab" verb="PUT" type="FileUploadApplication.ResultHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
但我总是收到不允许使用 405 方法"的错误消息.回复说允许的方法如下:
But I always get a "405 method not allowed" error. The response said the allowed methods are as below:
Headers = {Allow: GET, HEAD, OPTIONS, TRACE
Content-Length: 1293
Content-Type: text/html
Date: Fri, 27 May 2011 02:08:18 GMT
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET}
即使我在 Web 应用程序的 IIS 请求过滤中明确允许 PUT 方法,同样的错误仍然发生.
Even if I explicitly allow the PUT method in the IIS Request Filtering for my web application, the same error still occurs.
我怀疑这是一个与 IIS 相关的问题.我希望有人能帮我解释一下.
I suspect this is a IIS related issue. I'm hoping someone could shed some light on this for me.
推荐答案
我启用了失败请求跟踪,并得到以下信息:
I enabled the Failed Request Tracing, and got the following info:
<EventData>
<Data Name="ContextId">{00000000-0000-0000-0F00-0080000000FA}</Data>
<Data Name="ModuleName">WebDAVModule</Data>
<Data Name="Notification">16</Data>
<Data Name="HttpStatus">405</Data>
<Data Name="HttpReason">Method Not Allowed</Data>
<Data Name="HttpSubStatus">0</Data>
<Data Name="ErrorCode">0</Data>
<Data Name="ConfigExceptionInfo"></Data>
</EventData>
所以,我从我的 IIS 中卸载了 WebDAVModule,现在一切都很好~
So, I uninstalled the WebDAVModule from my IIS, everything is fine now~
IIS 跟踪功能非常有用.
The IIS tracing feature is very helpful.
这篇关于“405 方法不允许"在 IIS7.5 中“PUT"方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!