console.log(ret.data)
})
2.2 restful 形式传递参数
axios.get(‘http://localhost:3000/axios/123’).then(function(ret){
console.log(ret.data)
})
2.3 通过params 形式传递参数
axios.get(‘http://localhost:3000/axios’, {
params: {
id: 789
}
}).then(function(ret){
console.log(ret.data)
})
#3 axios delete 请求传参 传参的形式和 get 请求一样
axios.delete(‘http://localhost:3000/axios’, {
params: {
id: 111
}
}).then(function(ret){
console.log(ret.data)
})
4 axios 的 post 请求
4.1 通过选项传递参数
axios.post(‘http://localhost:3000/axios’, {
uname: ‘lisi’,
pwd: 123
}).then(function(ret){
console.log(ret.data)
})