Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by BigRare (Pilgrim)
on May 22, 2006 at 19:27 UTC ( [id://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 learning in the Monastery: (3)
As of 2024-04-20 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found