MLUG: Re: [MLUG] perl/http auth question
Re: [MLUG] perl/http auth question
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
For future reference, this is what I got to work (before I saw your
post):

my $userAgent = LWP::UserAgent->new(agent => '<agent identifying
string>');
$userAgent->credentials("<ip:port>","<login realm>",'username' =>
'password');
my $response = $userAgent->request(POST "$url",
Content_Type => 'text/xml',
Content => $message);
print $response->as_string;

But thanks for the suggestion.

Rick

On Mon, 2007-10-08 at 16:14 -0500, nowlind wrote:
> Not sure if this will help but this is what I use in a perl program that 
> I wrote to login to my router.  It is used in a dyndns updater:
> 
>   $browser->agent( $agent );
>   $browser = LWP::UserAgent->new;
>   $req = HTTP::Request->new(GET => $url);
>   $req->authorization_basic($conf{"login"}, $conf{"password"});
>   $responce = $browser->request($req);
>   $code = $responce->code;
>   $msg = $responce->message;
>   $content = $responce->content;
>   error_rtn("Error sending update: $code $msg $content") unless 
> $browser->request($req)->is_success;

-- 
breakfast noir:
..."Without thinking, I crammed that deadly sliver of metal carrying the
city's most infamous breakfast food into my maw. The tiny flakes snapped
and popped, like the fingers of a mob snitch after they found 'im. It
wasn't good cereal. But it was better than a gut fulla led."


_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members