【发布时间】:2019-05-02 09:19:56
【问题描述】:
http post 在 chrome 浏览器上不工作,但在 firefox 和 edge 上工作正常
我有一个带有 angular7 和 netcore 2.2 的应用程序,crud 示例在所有浏览器中都可以正常工作,除了保存方法(具有 http.post)在 chrome 上不起作用
save(user: UserModel): Observable<ResponseObj> {
const body = JSON.stringify(user);
const headers = new Headers({ "Content-Type": "application/json" });
const options = new RequestOptions({ headers: headers });
return this._http.post("/api/Users/Save", body, options)
.pipe(map(res => res.json()))
.pipe(catchError(this.handleError));
}
我希望调用服务器 api 并创建新用户
【问题讨论】:
-
能否为 chrome 中出现的错误添加屏幕截图?
-
您遇到的错误是什么?
-
请清除 chrome 中的缓存
-
出现错误:SyntaxError: Unexpected token