in reply to How to Get around Proxy
The code below uses LWP in debug mode to work through the problem.
#! /usr/bin/perl -w use strict; use warnings; use LWP::Debug qw(+); #for debugging info use LWP::UserAgent; use HTTP::Request; use HTTP::Response; use HTTP::Date; # Create a user agent that uses the proxy info from the environment my $ua = LWP::UserAgent->new(env_proxy=>1); # Create the request my $request = HTTP::Request->new('GET'=>'http://www.perlmonks.com/'); # Add the If-Modified-Since header $request->push_header (if_modified_since=>time2str(time)); #Submit your request my $response = $ua->request($request); if ($response->is_success) { print "Retrieved URL OK\n"; } else { print $response->status_line . "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How to Get around Proxy
by tachyon (Chancellor) on Oct 27, 2003 at 23:16 UTC | |
by Kanishka (Beadle) on Oct 30, 2003 at 04:09 UTC |