En-tête de passes en Ajax
$.ajax({
url: "/test",
headers: {"X-Test-Header": "test-value"}
});
Lokesh003
$.ajax({
url: "/test",
headers: {"X-Test-Header": "test-value"}
});
$.ajax({
url: "http://localhost/myawsomecode/",
data: { param1: 'anyvalue', param2: 'othervalue' },
type: "GET",
beforeSend: function(xhr){xhr.setRequestHeader('X-Test-Header', 'SetHereYourValueForTheHeader');},
success: function() { alert('Success!'); }
});