axios post、get参数和header配置

1、post

axios.post(“http://xxx.com/xxx/xxx/xxx”,

                {                        'queslistid':this.kemuid

                },

                {

                    headers: {'token':Cookies.get('token'),'platform': 'web'}

                }

            ).then((login)=>{

               console.log(login)

            })

2、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)

            })

如有转载请注明出处,洋葱先生(http://www.dreamload.cn/blog/?p=915)

猜你喜欢

转载自blog.csdn.net/Kindergarten_Sir/article/details/108601075