in reply to Mimic referring URL in LWP?
HTTP::Headers has a referer method (yes, it's mis-spelt in the HTTP standard, too). It does exactly what you expect in that it sets the Referer header in the HTTP request.
You should be able to tweak the HTTP::Headers object that is used by your request:
$req->headers->referer("http://www.perlmonks.org/");
In fact, according to the HTTP::Message documentation, all unknown methods are fobbed off to the appropriate HTTP::Headers object, so the following also works:
$req->referer("http://www.perlmonks.org/");
Couldn't be much more simple than that. :)
Paul Fenwick
Perl Training Australia
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Mimic referring URL in LWP?
by inblosam (Monk) on Jun 20, 2002 at 03:14 UTC | |
by pjf (Curate) on Jun 21, 2002 at 04:00 UTC |
In Section
Seekers of Perl Wisdom