axios發送post請求,如何提交表單數據?


var app = new Vue({ el: "#register", data: { registerUrl: "/KindlePocket/bindingData" newUserInfo: { userName:'n', phone:'13', email:'12', emailPwd:'22', kindleEmail:'asd' } }, methods: { register: function() { axios.post(this.registerUrl, this.newUserInfo, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); } } })


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM