首页 > 移动平台 > 详细

axios发送post请求,如何提交表单数据?

时间:2017-09-06 15:20:53      阅读:381      评论:0      收藏:0      [点我收藏+]
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);
                  });
            
        }
    }
})

axios发送post请求,如何提交表单数据?

原文:http://www.cnblogs.com/lyls/p/7484774.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!