首页 > 移动平台 > 详细

axios get,post请求时带headers

时间:2019-12-20 23:48:07      阅读:364      评论:0      收藏:0      [点我收藏+]

axios post请求时带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请求时带headers:

    axios.get("http://xxx.com/xxx/?", { params: { id: this.kemuid }, headers: { token: Cookies.get(‘token‘), platform: ‘web‘ } }
    ).then((res) => {
      console.log(res);
    });

  

axios get,post请求时带headers

原文:https://www.cnblogs.com/wolfocme110/p/12075355.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!