This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

The XMLHttpRequest Object

The getAllResponseHeaders() function returns all the header information of a resource, like length, server-type, content-type, last-modified, etc:

const xhttp = new XMLHttpRequest();
xhttp.onload = function() {

// display all server headers for the XMLRequest Object
  document.getElementById("demo").innerHTML =
  this.getAllResponseHeaders();
};

// defines the XMLHttpRequest Object
xhttp.open("GET", "ajax_info.txt");
xhttp.send();