1

I am looking to get/return the response headers of an already made request using js in the browser console. I do not wish to use the XMLHTTPRequest object as it makes another request.

I tried using the window.performance object in the js console, but failed to get the response header of the already made request on the page. Does anybody have an idea how to do this?

jsmith
  • 89
  • 1
  • 15
  • 1
    What do you mean by "the XMLHTTPRequest object […] makes another request."? When you get the onreadystate callback, the original XHR object that started the request will contain the data you want, and it's the only way to get it. – Touffy Mar 29 '15 at 15:41
  • i meant that i dont want to use it to make another request. the idea is to get the response header of a request that is already made as soon as the page is accessed. – jsmith Mar 29 '15 at 15:55
  • seems like a dupe http://stackoverflow.com/questions/220231/accessing-the-web-pages-http-headers-in-javascript – David Chase Mar 29 '15 at 16:13
  • Can you clarify? are you trying to get the headers of a request made with XHR or do you want the headers of the current HTML document? (in which case, follow David's link) – Touffy Mar 29 '15 at 16:33

0 Answers0