access custom http header

Posted by jmls on 24-Aug-2013 03:45

I have a web front end that is adding some data to a custom http header : see the headers being sent :

Accept:application/json, text/javascript, */*; q=0.01

Accept-Encoding: gzip,deflate,sdch

Accept-Language: en-GB,en-US;q=0.8,en;q=0.6

Connection: keep-alive

Host: 192.168.99.222

Referer: http://192.168.99.222/sports/

User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36

X-Requested-With:  XMLHttpRequest

X-foobar: somedata

how can I get the contents of X-foobar ? it's not a form field, nor a CGI variable

thanks

Julian

All Replies

Posted by jmls on 24-Aug-2013 04:56

and, of course, I work out the answer and make myself look stupid

get-cgi("HTTP_X_FOOBAR") will give me what I need (all - are converted to _ and http_ added to the front)

This thread is closed