GET请求
axios
.get('https://www.runoob.com/try/ajax/json_demo.json')
.then(response => (this.info = response))
.catch(function (error) {
// 请求失败处理
console.log(error);
});
POST请求
axios
.post('https://www.runoob.com/try/ajax/demo_axios_post.php')
.then(response => (this.info = response))
.catch(function (error) {
// 请求失败处理
console.log(error);
});