使用axios提交类型为application/x-www-form-urlencoded数据的正确姿势:
let formData = new URLSearchParams() formData.append('param1', param1) formData.append('param2', param2) axios({ url: 'http://xxx.xxx.xxx.xxx/xxx', method: 'method', headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, data: formData }).then(response => { // your logic processing response }, error => { // your logic dealing with error })
效果如下
标签:www,axios,form,formData,xxx,application,urlencoded From: https://www.cnblogs.com/Im-Victor/p/17358789.html