axios不基于任何库和框架
//没有请求体的
axios.get("url") //就是一个promise对象
.then(res=>{
//res 使用相应对象 包含了响应的数据 res.data
})
.catch(err=>{
//err 错误对象 err.message
})
//有请求体的
axios.post("url",{
//请求主体的数据
key1: value1,
key2:value2
})
.then(res=>{
console.log(res.data);
})
.catch(err=>{
console.log(err);l
})
axios.get();
axios.post();
axios.put();
axios.delete()