axios 参数为payload的解决方法

Posted 百里登风

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了axios 参数为payload的解决方法相关的知识,希望对你有一定的参考价值。

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);
  });

 

以上是关于axios 参数为payload的解决方法的主要内容,如果未能解决你的问题,请参考以下文章