当前阅读教程:Vue.JS入门教程 > POST 方法 | |
阅读(22555525) 收藏 赞(5685) 分享 | |
上一篇: GET 方法 | 下一篇: 执行多个并发请求 |
POST 实例 new Vue({ el: '#app', data () { return { info: null } }, mounted () { axios .post('https://域名/demo_axios_post.php') .then(response => (this.info = response)) .catch(function (error) { // 请求失败处理 console.log(error); }); } })
POST 方法传递参数格式如下: 传递参数说明 axios.post('/user', { firstName: 'Fred', // 参数 firstName lastName: 'Flintstone' // 参数 lastName }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); |
|
上一篇: GET 方法 | 下一篇: 执行多个并发请求 |