Axios放置标头

时间:2018-10-03 05:12:50

标签: api header axios

 axios({
  method: 'post',
  url: 'myapi',
  headers: {'Authorization': Cookies.get('token')},
})
  .then((response) => {
    this.setState({ data: response.data.recommemdation });
  })
  .catch(function (response) {
    console.log(response);
  });

我无法将标头添加到我的请求中,并带有400的api响应 尝试使用标头:{'Authorization':Cookies.get('token')},邮递员响应正常

0 个答案:

没有答案