我们有一个 ASP.NET Core 2.0 该网站还提供了几个简单的 网络 API 用于 UI 增强目的的方法。
网络 API 在 下本地运行时,调用按预期工作IIS Express ,但是当我们部署到我们的 IIS 8.5 生产网络服务器,我们在制作 HTTP DELETE
时收到以下错误和 PUT
要求...
405 Method Not Allowed
经过一些网络搜索,我们发现了一些建议删除 IIS 的帖子。 WebDAV 模块。我们在 IIS 中禁用了它(它是我们的服务器),我们还尝试了以下方法:
Allow verb filtering = False
aspNetCore
, WebDAV
和 ExtensionlessUrlHandler-Integrated-4.0
以上步骤都没有解决我们的问题。
任何建议/方向将不胜感激。
最佳答案
这对我有用(netcore 2.0)
<system.webServer>
<modules runAllManagedModulesForAllRequests="false">
<remove name="WebDAVModule" />
</modules>
</system.webServer>
在这里找到:https://www.ryadel.com/en/error-405-methods-not-allowed-asp-net-core-put-delete-requests/
关于带有 IIS 的 ASP.NET Core - 不允许使用 HTTP 动词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48188895/