axios post、get 请求参数和headers配置

 

         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("http://xxx.com/xxx/xxx/xxx?",{
                        params:{id:this.kemuid},
                        headers:{token:Cookies.get('token'), platform: 'web'}
                    }).then((res)=>{
                        console.log(res)
                })

 

posted @ 2019-06-05 20:05  前端王者(法师)  阅读(13191)  评论(0编辑  收藏  举报