贴上官网链接: link.
get方式请求
this.axios
.get(
"http://www.*****.com",
{
headers: { Authorization: this.tokens }, //设置的请求头
//传入的参数
params: {
activity_code: this.codes,
id:this.id
}
}
)
.then(ok=>{
console.log(ok);
})
.catch(err=>{
console.log(err.response);
})
post方式请求
this.axios
.post(
"http://www.*****.com",
//设置的请求头
{ headers: { Authorization: this.tokens } },
//传入的参数
{
activity_code: this.codes,
id:this.id
}
)
.then(ok=>{
console.log(ok);
})
.catch(err=>{
console.log(err.response);
})