axios 参数为payload的解决方法

时间:2017-02-04 20:15:54   收藏:0   阅读:1549

1.加

headers: {
    ‘Content-Type‘: ‘application/x-www-form-urlencoded‘,
  },
self.axios.post(url, {a: 1, b:2}, {
  headers: {
    ‘Content-Type‘: ‘application/x-www-form-urlencoded‘,
  },
}).then(response => response.data)
  .then(data => {
    console.log(data);
  });

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!