iisnode-执行PUT请求时不允许IIS7.5:405方法 [英] iisnode - IIS7.5: 405 Method not allowed when performing PUT request
问题描述
我开始对iisnode和 expressjs 做一些实验,以创建带有node的REST API.
I started to do some experimentation with iisnode and expressjs to create a REST like API with node.
因此,在server.js上,我创建了类似的内容
So on the server.js I created something like
app.put("/test", function(req, res){
...
});
但是,当我执行PUT请求时,我从IIS 7.5安装中得到了405 Method not allowed
.
However, when I execute the PUT request I get a 405 Method not allowed
from the IIS 7.5 installation.
关于如何解决此问题的任何想法?
Any idea on how to solve this?
顺便说一句,我已经在Google上搜索了一下,试图在不同的Handler映射中到处添加PUT动词,但没有成功...
推荐答案
我现在终于找到了解决该问题的方法,即WebDavModule阻止了我的PUT请求.
I now finally found the solution to this problem namely the WebDavModule was blocking my PUT requests.
要解决此问题,请执行以下操作:
To resolve the issue:
- 打开您的IIS管理器
- 转到您的应用程序配置并打开模块"
- 搜索WebDavModule并将其删除(右侧菜单)
然后对我有用.
或者,在应用程序的web.config中添加
Alternatively, in your application's web.config add
<system.webServer>
...
<modules>
<remove name="WebDAVModule"/>
</modules>
</system.webServer>
这篇关于iisnode-执行PUT请求时不允许IIS7.5:405方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!