In one of my code I've the following jQuery AJAX call
$.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);
}
})
I have got the following output:
- Output-01:
content-type: application/json
- Output-02:
null
I can't figure out what did I do wrong?