pass header in ajax
$.ajax({
url: "/test",
headers: {"X-Test-Header": "test-value"}
});
pass header in ajax
$.ajax({
url: "/test",
headers: {"X-Test-Header": "test-value"}
});
ajax add header
$.ajax({
type: "POST",
beforeSend: function(request) {
request.setRequestHeader("Authority", authorizationToken);
},
url: "entities",
data: "json=" + escape(JSON.stringify(createRequestObject)),
processData: false,
success: function(msg) {
$("#results").append("The result =" + StringifyPretty(msg));
}
});
javascript access ajax response headers
// Remember to add JQuery to your html head!
var xhr = $.ajax({
url: 'someurl',
complete: function(data) {
// Access your response headers by using return value
xhr.getResponseHeader("date"); // Specify here the type of header
}
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us