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 @ 2018-12-12 11:04  Du.Du  阅读(33774)  评论(0编辑  收藏  举报