您的位置:首页 > 其它

ajax发送头信息

2016-08-18 15:02 99 查看
$.ajax({
url: "http://localhost:1005/api/values",
type: "GET",
beforeSend: function (xhr) {
xhr.setRequestHeader("X-Custom-Header1", "Bar");
},
success: function (data) {
alert(data);
},
error: function (xhr, textStatus, errorThrow) {
alert(xhr.readyState);
}
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ajax header