Home: General Discussions: General Questions:
Check Http Request Headers



shezam
New User

Jan 30, 2009, 4:22 AM


Views: 3855
Check Http Request Headers

Hi Guys,

I have a test webserver, and based on what request headers i receive i want to end back a 302.

So i want to do the following;

#!/usr/bin/perl
print "status: 302\n";
print "location: http://news.bbc.co.uk\n";
print "Content-type: text/plain\n";
print "\n";
print <<"EOM";
Go read the news
EOM

as an example but only based on what request headers i receive. Any you guys know how to check for the headers or how i should do this. Help much appreciated. Thanks.