Is it possible to get the HTTP-Headers of the client?
i´ve seen the function WEBLib.WebTools.GetQueryParam(AName:string):string
. Is there something similar for http-Headers or is this not possible?
Is it possible to get the HTTP-Headers of the client?
i´ve seen the function WEBLib.WebTools.GetQueryParam(AName:string):string
. Is there something similar for http-Headers or is this not possible?
What exactly do you mean with "HTTP headers of the client"?
Your reference to GetQueryParam seems to indicate you look for the headers the browser uses to request a page? Or is it something else you look for?
Yes i´m looking for the headers which the client is sending with the Request of the page.
I found no evidence that there is a client-side API to get to know the headers the browser is sending for page requests.
Here is information I found about what headers are being sent:
https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending/
Other approach is via a server echo tool
To see the headers your browser is sending to the server when it retrieves a page, you can use JavaScript in combination with a server-side script or a browser's developer tools. Here’s a method using JavaScript with Fetch API and a server-side echo service:
You can make a fetch
request to an echo service that simply returns the headers you sent to it. There are public APIs designed to return the headers sent in a request, such as https://httpbin.org/headers
.
Here is how you can do it:
javascript
Copy code
fetch('https://httpbin.org/headers')
.then(response => response.json())
.then(data => console.log(data.headers))
.catch(error => console.error('Error:', error));
XMLHttpRequest
.This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.