angular - 标头在打字稿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);
解决方案
推荐阅读
- python - 如何将 tkinter 函数推入新窗口?
- php - 黑客能否开始上传文件并指定何时上传?
- python - 枕头 - GIF 文件大小
- r - R中的自定义表(SPSS)?
- solr - Sitecore - 执行完整索引重建后索引中缺少某些项目
- kotlin - Kotlin:使用反射设置带注释的lateinit var
- solr - 在 Solr DIH 中导入嵌套实体
- node.js - 将 mono repo 部署到 Heroku、Node.JS、Angular 9。Heroku CLI
- java - 读取列包含逗号的 CSV
- python - 如何使用 ctypes 将字节转换为浮点数?