标头在Typescript Angular中不起作用

时间:2019-05-29 15:46:31

标签: angular header

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

我仍然清理了cheche和错误。

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);

0 个答案:

没有答案