获取头部信息
$.ajax({ success: function(data, status, xhr) { console.log(xhr.getResponseHeader("Content-Type")); } });
设置头部信息
一、setting参数 headers
$.ajax({
headers: {Accept: "application/json; charset=utf-8"
},
type: "get",
success: function (data) {
}
});
二、beforeSend方法
$("#test").click(function() {
$.ajax({
type: