【发布时间】:2018-06-18 19:08:00
【问题描述】:
在本地环境测试时遇到HTTP错误403。
在我的 Angular 服务文件中,我将标头设置如下:
const apiArgs: RequestOptions = new RequestOptions();
const headers = new Headers();
headers.append('Content-Type', 'application/json;');
apiArgs.headers = headers;
还有一个我做的 POST 调用示例
return this.http.post(environment.urlPath, JSON.stringify(output), apiArgs)
但是这会导致以下错误:
Response for preflight has invalid HTTP status code 403
需要配置什么?
【问题讨论】:
-
看起来问题来自服务器而不是角度方面
-
是的,问题来自服务器端。谢谢
标签: angular http-status-code-404 preflight