首页 > 解决方案 > 标头在打字稿Angular中不起作用

问题描述

我正在使用 angular,但是当我在 ngnix 服务器中运行 de app 时,服务器无法识别标头 x-nonce。API 发送:400 错误。我不知道为什么浏览器不将 x-nonce 标头发送到 api 服务。

我清理了chache,错误仍然存​​在。

const httpOptions = {
  headers: new HttpHeaders({
    'Authorization': token,
    'x-nonce': uuid(),
    'x-date': fecha.toUTCString()
  }),
  params: new HttpParams()
    .set('company', filter._company)
    .set('user', filter._user)
    .set('skip', skipt)
    .set('limit', limit)
};

返回 this.http.get(this.apiEndpointReports, httpOptions);

标签: angularheader

解决方案


推荐阅读