requirements:
want to add a js script to the page to get the Headers information of the current page.
problems encountered:
now you can only get Response Headers data, using the following code:
var req = new XMLHttpRequest();
req.open("GET", document.location.href, false);
req.send(null);
var headers = req.getAllResponseHeaders();
console.log(headers);
but the RequestHeaders data cannot be obtained, and no getAllRequestHeaders ()-like method is found.
I wonder if the js script can get the information about request header on the page.
Thank you, everyone!