Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: how to add a refer to LWP::UserAgent

by BigRare (Pilgrim)
on May 22, 2006 at 19:27 UTC ( #551015=note: print w/replies, xml ) Need Help??


in reply to how to add a refer to LWP::UserAgent

It would go something along the lines of this:
# Create a user agent object use LWP::UserAgent; $ua = LWP::UserAgent->new; $ua->agent("ima User Agent"); # Create a request my $req = HTTP::Request->new(GET => 'http://www.google.com'); $req->header(Accept => "text/html, */*;q=0.1", referer => 'http://ww +w.test.com/); # Pass request to the user agent and get a response back my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { print $res->content; } else { print $res->status_line, "\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://551015]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2023-12-09 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (37 votes). Check out past polls.

    Notices?