【发布时间】:2014-01-14 14:07:33
【问题描述】:
我在向其他域上的 Web API 发出 PUT 和 DELETE CORS 请求时遇到了一些麻烦。
我已经通过教程http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api#create-webapi-project 编写了 API。
GET 和 POST 请求工作正常,但 DELETE 和 PUT 不能。我收到这条消息:
Failed to load resource: the server responded with a status of 405 (Method Not Allowed)
Failed to load resource: No 'Access-Control-Allow-Origin' header is present on the requested resource.
当我向 CORS support for PUT and DELETE with ASP.NET Web API 建议的 WebConfig 添加代码时,我只收到第一个错误。
谁能帮我解决这个问题?
【问题讨论】:
标签: .net cors http-delete preflight