Axios
是一个基于 promise 的 HTTP 库,可以用在浏览器和 node.js 中。
常用的请求方法别名一般有: Get/post/http协议请求
执行Get请求
function get(){
return axios.get('/data.json', {
params:{
id:1234
}
}).then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});