在我的一个代码中,我进行了以下jQuery AJAX调用
$.ajax({
url: "https://api.myapi.com/v1/post/",
type: "POST",
dataType: "json",
data: JSON.stringify(body),
success: function (data, status, xhr)
{
console.log(xhr.getAllResponseHeaders()); // Output-01
console.log(xhr.getResponseHeader('Authorization')); // Output-02
},
error: function (data) {
//console.log(data);
}
})
我有以下输出:
content-type: application/json
null
我无法弄清楚我做错了什么?