Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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/referer.pl 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/referer.pl 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="192.168.0.1" REMOTE_PORT="2524" REQUEST_METHOD="GET" REQUEST_URI="/cgi-bin/printenv" [snip remainder of environment]

-dlc


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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-07-08 01:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls