Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Minor changes from the showheaders.js found at Discovering some nice features...
// showheaders.js
// Little changes (for Firebug) from
// Print out response headers for current URL.
var request = new XMLHttpRequest();'HEAD', window.location, false);
var headers = request.getAllResponseHeaders();
var tab = headers.split("\r\n").map(function(h)
var hp = h.split(": ");
return { "Key": hp[0], "Value": hp[1] }
}).filter(function(h) { return h.Value !== undefined; });"Request Headers");
console.groupEnd("Request Headers");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment