Is it possible to gather the HTTP headers in JavaScript ?
This is just a thought of mine after using Firebug for days.
In one of the posts I came to know that, it is impossible to find the HTTP headers in JavaScript, whereas in firebug, we can see the response headers (client side)
so my question is can we cache the HTTP headers in JavaScript ?
The HTTP headers aren’t available in JavaScript.
However you could use
XMLHttpRequestto do aHEADrequest to any resource within the same domain:The above will return something like this (running it in Firebug on this page):
You can easily get the value of single headers like this: