webapi发布常见错误及解决方案
错误一:
错误:404 (Not Found)
解决方案:
在 <system.webServer>节点中添加如下模块:
<modules runAllManagedModulesForAllRequests="true" />
错误二:
错误:405 (Method Not Allowed)或者Response for preflight has invalid HTTP status code 405.
解决方案:
在 <system.webServer>节点中添加如下模块:
-<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
原文地址:https://www.cnblogs.com/zlp520/p/9436645.html
时间: 2024-10-09 17:37:10