Web API 405方法不允许

时间:2014-07-03 00:49:46

标签: asp.net-web-api http-status-code-405

仍然没有找到适用于我的网站的解决方案。这是我的web.config

<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
  <remove name="WebDAVModule" />
</modules>
<httpProtocol>
  <customHeaders>
    <add name="Access-Control-Allow-Origin" value="*" />
    <add name="Access-Control-Allow-Methods" value="GET,PUT,POST,DELETE" />
    <add name="Access-Control-Max-Age" value="1000" />
    <add name="Access-Control-Allow-Headers" value="Content-Type" />
  </customHeaders>
</httpProtocol>
<handlers>
  <remove name="WebDAV" />
  <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>

我删除了WebDAV模块和处理程序。我已经包含了&#34; runAllManagedModulesForAllRequests&#34;甚至添加了自定义标题。为什么我仍然会看到这个错误? TIA

0 个答案:

没有答案