in reply to Re^2: Getting past a password prompt in perl
in thread Getting past a password prompt in perl

Are you posting the actual code you're running (presumably tomcatQA.pl)? If not, please do.

Maybe try the following (add before your print $mech->content()) and post the output here?

use Data::Dumper; print Dumper $mech->response; # dump returned HTTP::Response object

One other thing - you don't need to explicitly use HTTP::Request because WWW::Mechanize will use it for you.


Life is denied by lack of attention,
whether it be to cleaning windows
or trying to write a masterpiece...
-- Nadia Boulanger

Replies are listed 'Best First'.
Re^4: Getting past a password prompt in perl
by Anonymous Monk on Mar 02, 2011 at 17:44 UTC
    It seems I get the 401 unauthorized as well. So not sure if this is valid solution? Any help here ?
    my $mech = WWW::Mechanize->new; my $username = "user"; my $password = "pass"; my $host="somehost"; my $port="12001" $mech->credentials("$host:$port", "Tomcat Manager Application", "$ +username", "$password"); $mech->get("$url/manager/list"); print Dumper $mech->response; # print $mech->content();