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

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]


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 having an uproarious good time at the Monastery: (13)
As of 2016-10-24 14:23 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (307 votes). Check out past polls.