- axios基本请求
- axios.get(url, config)
- axios.post(url, data, config)
- axios(config)
axios({
url:'http://123.207.32.32:8000/home/data'
//专门针对get请求的参数拼接
params:{
type:'pop',
page:1
}
}).then(res=>{
console.log(res);
}).catch(err=>{
})
- axios发送并发请求同时到达了才执行
axios.all([axios({
url:'http://123.207.32.32:80/home/multidata'
}),axios(
url:'http://123.207.32.32:8000/home/data'
params:{
type:'get',
page:1
}
)]).then(axios.spread((res1,res2)=>{
console.log(res1)
console.log(res2)
}))
```
网友评论