<?xml version="1.0" encoding="windows-1252"?>
<node id="427129" title="davidrw's scratchpad" created="2005-02-01 22:25:09" updated="2005-08-11 16:33:28">
<type id="182711">
scratchpad</type>
<author id="245082">
davidrw</author>
<data>
<field name="doctext">
&lt;code&gt;
use strict;
use warnings;
use WWW::Mechanize;
use MIME::Base64;

my $PW = 'PWPWPW';

my $auth = MIME::Base64::encode("" . ':' . $PW);

my $mech = WWW::Mechanize-&gt;new();
#$mech-&gt;default_headers-&gt;authorization_basic("", $pw);

$mech-&gt;add_header( 'Authorization' =&gt; 'Basic ' . $auth );

$mech-&gt;get('http://192.168.1.254/left1.htm');

print $mech-&gt;content;

__END__

my $mech = WWW::Mechanize-&gt;new();
my @args = (Authorization =&gt; "Basic " .
            MIME::Base64::encode("" . ':' . $PW));
$mech-&gt;credentials('192.168.1.254:80', 'ABCDEF', "", $PW);
$mech-&gt;get('http://192.168.1.254/', @args);

print $mech-&gt;content;

warn             MIME::Base64::encode("" . ':' . $PW) . "-";

__END__

my $mech = WWW::Mechanize-&gt;new();
#$mech-&gt;default_headers-&gt;authorization_basic("", $pw);

#$mech-&gt;add_header( 'Authorization' =&gt; 'Basic OmVsbHkwMA==' );

#$mech-&gt;get('http://192.168.1.254/left1.htm');

$mech-&gt;get('http://www.google.com');

print $mech-&gt;content;
&lt;/code&gt;
</field>
</data>
</node>
