jquery ajax 设置请求头header 参数

$.ajax(
                {
                    url:'http://127.0.0.1:30080/api-a/quasiCustom/selectCustomList',
                    type:'post',
                    dateType:'json',
                    beforeSend: function(xhr) {
                        xhr.setRequestHeader("organId:'1333333333'");
                    },
                    headers:{'Content-Type':'application/json;charset=utf8','organId':'1333333333'},
                    data:JSON.stringify(org),
                    success:function(data){console.log("sucess");},
                    error:function(data){console.log("error");}
                }
            );

  

 

posted @ 2020-12-21 14:24  浅笑19  阅读(1856)  评论(0编辑  收藏  举报