How can I get HTTP Header values from Coldfusion?
(ColdFusion version: 6.2..)
HTTP headers are the name or value pairs that are displayed in the request and response messages of message headers for Hypertext Transfer Protocol (HTTP). Usually, the header name and the value are separated by a single colon. HTTP headers are an integral part of HTTP requests and responses.
The Cookie HTTP request header contains stored HTTP cookies associated with the server (i.e. previously sent by the server with the Set-Cookie header or set in JavaScript using Document. cookie ). The Cookie header is optional and may be omitted if, for example, the browser's privacy settings block cookies.
I found the answer here in this post:
http://www.bennadel.com/blog/1425-Getting-Header-Values-From-A-ColdFusion-Request.htm
"Ben Nadel" had a great answer in there.
Similar example:
someVariable = getHttpRequestData().headers["User-Agent"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With