
//格式编码数据可以直接在headers设置
axios.post('url',data,{headers:{ 'Content-type': 'application/x-www-form-urlencoded'}})
// 不想在每次请求都设置的话,可以集中设置
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
//在vue模板用进行转换
import qs from 'qs'
var data = qs.stringify({"name":"xiaomi"});
axios.post('url',data).then()
上面是“vue中解决post方法application/x-www-form-urlencoded格式编码数据”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_14677.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

vue项目指定区域打印功能(指定区域不打印)
游戏时光VGTime:专注于游戏资讯、评测、专题和电商的综合游戏平台
艾米达日基金会:一家以展示高水准艺术展览而闻名的博物馆
一个收录了糖尿病数据的门户网站——Diabetes Data Portal
Meteor Shower from Space官网入口,一个专注于流星雨观测的网站