一、为什么选择axios
二、axios的基本使用
// 1.axios基本使用
axios({
url: "http://123.207.32.32:8000/home/multidata",
method: 'get' //默认是get请求
}).then(res=>{
console.log(res);
})
// axios.post()
axios({
// url: "http://123.207.32.32:8000/home/data?type=sell&page=1",
url: "http://123.207.32.32:8000/home/data",
params: {
type: "sell",
page: 1
},
method: 'get' //默认是get请求
}).then(res=>{
console.log(res);
})
<