in reply to Re: LWP error 500
in thread LWP error 500

Hi,

If your proxy asks you for a userid & password you should do the following:

#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $ua = new LWP::UserAgent; $ua->agent("mYpErLsCrIpT.pl/3.0"); $ua->env_proxy; $ua->proxy(http=>'http://proxy.pxpost:8080'); my $req = new HTTP::Request "GET" => "http://www.slashdot.org"; $req->proxy_authorization_basic('gargle','ImNoTgOnNaTeLl'); print $ua->request($req)->as_string;
--
if ( 1 ) { $postman->ring() for (1..2); }

Replies are listed 'Best First'.
Re^3: LWP error 500
by inman (Curate) on Sep 01, 2005 at 08:54 UTC
    I prefer setting up the proxy information in the system environment or by modifying %ENV during the script. This provides maximum compatibility for modules like Crypt::SSLeay which would be required for https access but don't pick up the LWP proxy info.