1. 程式人生 > >ajax添加header信息

ajax添加header信息

ESS http data xmlhttp query pre header ear ati

$.ajax({
url:"xxx",
async:true,
dataType:"json",
contentType:"application/json",
data:{},
beforeSend: function (XMLHttpRequest) {XMLHttpRequest.setRequestHeader("Authorization", "bearer xxxxxxxxxx");}
success:function(result){}
});
http://www.w3school.com.cn/jquery/ajax_ajax.asp

ajax添加header信息