0
点赞
收藏
分享

微信扫一扫

axios添加请求头内容

GET请求

axios.get(urlString, 
{
headers: {
'token': token
...
},
params: {
param1: string,
param2: string
},
...
}
)
.then(res => fn)
.catch(e => fn)

POST请求

axios.post(urlString, 
{
data: data,
...
},
{
headers: {
'token': token
...
}
}
)
.then(res => fn)
.catch(e => fn)

 


举报

相关推荐

0 条评论