Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you set HTTP REFERER using LWP ?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Here is what I tried after looking at the docs at CPAN.org:

#!/usr/bin/perl

use LWP::UserAgent;
use HTTP::Request::Common;



$ua = new LWP::UserAgent;
$ua->agent('Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)');
$res = $ua->request(
GET " http_referer=>' );
$content = $res->content;

print "content-type: text/html\n\n";
print "$content";


The testall.cgi script reads every Enviornment Variable and returns an html page.

I can't seem to set the http_referer header variable.

What am I doing wrong?
 
Hi!

I don't know if you solved this but anyway I use:

use HTTP::Headers together with
$request->header("Referer" => $your_referer);

regards
"John"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top