【发布时间】:2020-08-15 19:53:43
【问题描述】:
有没有办法在 axios.all 方法中附加标头,或者我们必须将标头单独附加到每个请求。
axios.all([
axios.delete('http://localhost:5000/requests/'+{id}),
axios.post('http://localhost:5000/records/'+{id, response}),
],{
headers: {Authorization: localStorage.getItem('auth-token')}
}).then(res => console.log(res.data))
.catch(err => console.log(err));
【问题讨论】:
标签: javascript axios http-headers