405-尝试访问应用程序时不允许使用用于访问此页面的HTTP动词

时间:2018-10-15 20:20:23

标签: iis http-status-code-405

尝试访问应用程序时出现以下错误。该应用程序托管在IIS 8.5上

405 - HTTP verb used to access this page is not allowed.
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

我可以看到在请求引发错误的应用程序时发生了发布请求。我尝试了以下方法,但没有帮助

  1. 我按照博客之一的建议在根web.config中添加了以下标记,该标记避免了错误,但未找到404错误页面。我试图将页面重定向到根目录中的index.html,但似乎找不到它
<httpErrors>
    <remove statusCode="405" subStatusCode="-1" />
    <error statusCode="405" prefixLanguageFilePath="" path="index.html" responseMode="ExecuteURL" />
</httpErrors>
  1. 我还尝试在服务器角色下添加应用程序开发,但这也没有任何参考。

  2. 我尝试的第三个选项是在web.config文件中添加以下部分

<modules>   
<remove name="WebDAVModule"/> 
</modules> <handlers>   
<remove name="WebDAV" />   <remove name="ExtensionlessUrlHandler-Integrated-4.0" />   
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"
     

type =“ System.Web.Handlers.TransferRequestHandler”     preCondition =“ integratedMode,runtimeVersionv4.0” />   

0 个答案:

没有答案