How to send a HEAD request from Firefox

Use the JavaScript console in Firebug and run the following script snippet:

var xmlhttp = new XMLHttpRequest();
xmlhttp.open("HEAD", "the_url",true); // Async HEAD request (relative path to avoid cross-domain restrictions)
xmlhttp.onreadystatechange=function() {
  if (xmlhttp.readyState==4) { // make sure the request is complete
    alert(xmlhttp.getAllResponseHeaders()) // display the headers
  }
}
xmlhttp.send(null); // send request

Leave a Reply