Sifmole has asked for the wisdom of the Perl Monks concerning the following question:
Result:#!/usr/local/bin/perl -w use WWW::Mechanize; use strict; my $mech = WWW::Mechanize->new( ); my $url = 'https://mybox/bin/engine.cgi'; my $base = 'https://mybox'; my $username = 'foo'; my $password = 'foo'; $mech->credentials($base, $username, $password); $mech->get( $url ); use Data::Dumper; print Dumper($mech);
Two items:HTML><HEAD> <TITLE>401 Authorization Required</TITLE> </HEAD><BODY> <H1>Authorization Required</H1> This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn\'t understand how to supply the credentials required.<P> <HR> <ADDRESS>Apache/1.3.28 Server at [ip address] Port 443</ADDRESS> </BODY></HTML>
Edit: fixed code so that is matches what I really had ( both netlocs matching ).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW:::Mechanize and credentials
by brian_d_foy (Abbot) on Mar 09, 2005 at 15:35 UTC | |
by petdance (Parson) on Mar 10, 2005 at 17:41 UTC | |
|
Re: WWW:::Mechanize and credentials
by saintmike (Vicar) on Mar 09, 2005 at 15:29 UTC | |
|
Re: WWW:::Mechanize and credentials
by Limbic~Region (Chancellor) on Mar 09, 2005 at 15:52 UTC | |
by petdance (Parson) on Mar 10, 2005 at 17:42 UTC | |
|
Re: WWW:::Mechanize and credentials
by Sifmole (Chaplain) on Mar 09, 2005 at 16:09 UTC | |
by Anonymous Monk on Dec 19, 2013 at 08:44 UTC |