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 on 2018-09-12 17:32  风景1573  阅读(120089)  评论(0编辑  收藏  举报