asp.net web api http put delete , iis 返回400.0 找不到错误的解决办法.

39 篇文章 0 订阅
20 篇文章 0 订阅

记录一下出问题前我的iis配置:

1. 应用程序池:



错误是:




尝试解决办法(都不行):

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" />
        <handlers>
            <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
            <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
        </handlers>
</system.webServer>


<modules>
    <remove name="WebDAVModule" />
</modules>
<handlers>
    <remove name="WebDAV" />
</handlers>





最后的解决办法如下:

  1. Delete WebDAV from "Modules"
  2. Delete WebDAV from "Handler Mappings"
  3. I delete WebDAV from IIS components to make sure WebDAV not exists and restart Windows
  4. Go to "Handler Mappings" and find ExtensionlessUrlHandler (for 32 and 64 and Integrated), open it and go to "Request Restrictions" to second chapter "Verbs" and put some of the methods you need to the string. I have the next: GET,HEAD,POST,DEBUG,PUT I repeat the changes for three "ExtensionlessUrlHandler" states.
  5. I do not change Request Filtering settings
当然, 也要检查一下iis整体的谓词配置:

请求筛选-->http谓词设置:




最后正常运行的配置是:

只保留了"最后的解决办法"那个小节里的配置. 其他配置都按照iis默认配置



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值