Content-Type': 'application/x-www-form-urlencoded 接口传递参数的格式

后台接口要求headers={'Content-Type': 'application/x-www-form-urlencoded'}这种格式时,我们也需要用formData去传递参数

let formData = new FormData();
formData.append('content',JSON.stringify(content));
formData.append('id',this.editId);
this.$axios({
url:xxxxx,
method:'post',
data:formData
}).then(res=>{
if(res.data.success){

}
})
原文地址:https://www.cnblogs.com/xiebeibei/p/13528750.html