in reply to problem with credentials() of LWP::UserAgent
Traced into LWP::UserAgent, and finally figured out that the parameters I passed into the credentials() call are wrong. Here is the fixed code:
use LWP::UserAgent; use HTTP::Request; use strict; use warnings; my $ua = new LWP::UserAgent(); $ua->credentials("localhost:8080", "Tomcat Manager Application", "peip +", "930612"); my $req; if ($ARGV[0] eq "remove") { $req = new HTTP::Request("GET", "http://localhost:8080/manager/rem +ove?path=/hello1"); } elsif ($ARGV[0] eq "install") { $req = new HTTP::Request("GET", "http://localhost:8080/manager/ins +tall?path=/hello1&war=jar:file:/jwstutorial13/examples/web/hello1/dis +t/hello1.war!/"); } my $res = $ua->request($req); print $res->content();
I will continue work on it, to add Tk and XML parts. But first... Hey, my turkey is done!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: problem with credentials() of LWP::UserAgent
by xenchu (Friar) on Dec 26, 2003 at 00:16 UTC |