Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: LWP::UserAgent Questions

by dchetlin (Friar)
on Dec 08, 2000 at 19:09 UTC ( #45742=note: print w/ replies, xml ) Need Help??

in reply to LWP::UserAgent Questions

You'll want to mess with the HTTP::Request object that you pass to UserAgent when making your request.

For example,

[~] $ cat > tmp/ require LWP::UserAgent; my $r = HTTP::Request::->new('GET','http://web2/cgi-bin/printenv'); $r->header("REFERER", "foo"); my $ua = LWP::UserAgent::->new; print $ua->request($r)->content; [~] $ perl !$ perl tmp/ DOCUMENT_ROOT="/usr/local/apache/htdocs" GATEWAY_INTERFACE="CGI/1.1" HTTP_HOST="web2" HTTP_REFERER="foo" HTTP_USER_AGENT="libwww-perl/5.48" PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin" QUERY_STRING="" REMOTE_ADDR="" REMOTE_PORT="2524" REQUEST_METHOD="GET" REQUEST_URI="/cgi-bin/printenv" [snip remainder of environment]


Comment on Re: LWP::UserAgent Questions
Download Code
Replies are listed 'Best First'.
Re: Re: LWP::UserAgent Questions
by merlyn (Sage) on Dec 09, 2000 at 22:46 UTC

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2015-11-28 09:15 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (740 votes), past polls