axios使用

详细方式参考

get请求

方式一
axios.get('/user?ID=12345') .then(function (response) { // handle success console.log("success:"+response.status+","+JSON.stringify(response.data)); }) .catch(function (error) { // handle error console.log(error); }) .finally(function () { // always executed }); // 方式二 axios.get('/user', { params: { ID: 12345 } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }) .finally(function () { // always executed });

 

posted @ 2020-03-24 20:54  zincredible  阅读(215)  评论(0编辑  收藏  举报