【发布时间】:2018-04-11 10:40:28
【问题描述】:
我尝试在 Angular (4.2.4) 中执行 CORS 请求,并且在使用 GET 方法时一切正常。但是在执行 POST 请求时,我收到此错误:
Response for preflight has invalid HTTP status code 403
有标题截图:
【问题讨论】:
-
不是后端问题。我认为是 API 服务问题
-
添加选项请求的通配符 url 以使用您将手动发送的允许标头解析 cors,允许方法获取 post put delete & allow origin to your host 或 * 。例如。 /api/web/v2/*的选项方法