axios({ url: '/user', method: 'post', data: { firstName: 'Fred', lastName: 'Flintstone' }, transformRequest: [function (data) { // Do whatever you want to transform the data let ret = '' for (let it in data) { ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' } return ret }], headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
axios发送post请求,将数据以表单形式提交
原创
2020-07-03
Veddy
前端
43
完
- 本文作者:
- 原文链接:
- 版权声明: 本博客所有文章除特别声明外,均采用