mardi 25 août 2020

How to access Request Headers clientside (browser)?

I want to access the Request Headers in my client (browser) but can't figure out how to do it? I am initiating the request with XMLHttpRequest; the xhr instance that I have created allows me to access the response headers via getAllResponseHeaders() but it only contains the response headers as the method suggests. Is there any way of accessing the request headers via javascript? In particular, I want the Content-Length information from the request (The request body size actually). Any help will be appreciated.




Aucun commentaire:

Enregistrer un commentaire