Reputation: 316
I was wondering if it is possible to add http header information on a browser using jquery or a classic javascript in such a way that this added info will always available during http request like the "user-agent" sent in the server?
sorry on my wild imagination... ;)
Best regards, - toni
Upvotes: 2
Views: 5905
Reputation: 751
Since jQuery 1.5, there is a 'headers' option in the jQuery.ajax() method :
Try it this way :
$.ajax({
headers: {
'X-My-Custom-Header':'value';
},
// ... Your other parameters in order
// to define your request (url, method, etc.) ...
});
Upvotes: 3