.get
axios.get("http://xxx.com/xxx/xxx/xxx?",{
params:{id:this.kemuid},
headers:{token:Cookies.get('token'), platform: 'web'}
}).then((res)=>{
console.log(res)
})
.post
axios.post("http://xxx.com/xxx/xxx/xxx?",
{
'queslistid':this.kemuid
},
{
headers: {'token':Cookies.get('token'),'platform': 'web'}
}
).then((login)=>{
console.log(login)
})
本文介绍了如何使用axios库发送GET和POST请求。通过具体的代码示例,展示了如何设置请求参数,包括URL、请求体、头部信息等,并演示了如何处理响应。
1万+

被折叠的 条评论
为什么被折叠?



