安装
npm install axios --save
axios基本使用
axios({ url: 'http://123.207.32.32:8000/home/multidata', method: 'get'//不写默认get方式 }).then(res => { console.log(res.data) })
axios({//get请求带参数 url: 'http://123.207.32.32:8000/home/data', params: { type:'pop', page: 1 } }).then(res => { console.log(res.data) })
并发请求
axios.all([ axios('http://123.207.32.32:8000/home/multidata'), axios('http://123.207.32.32:8000/home/multidata') ]).then((results) => {//返回results数组 console.log(results) })
标签:axios,http,请求,res,32.32,home,8000 From: https://www.cnblogs.com/ixtao/p/16930451.html