小编Tiy*_*gan的帖子

从 axios 中的响应头获取数据

我正在使用 Axios 发出发布请求,此调用在响应标头和正文中返回数据。在标头中,它返回一个x-auth-token,我想获取此令牌的值,但它返回:

undefined is not an object
Run Code Online (Sandbox Code Playgroud)

这是我的做法:

undefined is not an object
Run Code Online (Sandbox Code Playgroud)

response promise response-headers axios

7
推荐指数
2
解决办法
1万
查看次数

标签 统计

axios ×1

promise ×1

response ×1

response-headers ×1