Limbic~Region has asked for the wisdom of the Perl Monks concerning the following question:
Now, I tried every incantation I could with $mech->credentials() and when I called it but every single time it would spit out an error saying POST failed because https://foo.com required authentication. Here is how I resolved it:
$mech->default_header(Authorization => 'Basic ' . encode_base64($user +. ':' . $pass)); $mech->get($url); $mech->submit();
Does anyone know why this was necessary and does anyone have a better solution (preferrably using credentials()?
Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Better Solution To WWW::Mechanize Basic Authentication
by MidLifeXis (Monsignor) on Oct 19, 2009 at 14:58 UTC | |
by Limbic~Region (Chancellor) on Oct 19, 2009 at 15:51 UTC | |
by MidLifeXis (Monsignor) on Oct 19, 2009 at 16:26 UTC | |
by almut (Canon) on Oct 19, 2009 at 16:52 UTC | |
by MidLifeXis (Monsignor) on Oct 19, 2009 at 17:04 UTC | |
by Limbic~Region (Chancellor) on Oct 19, 2009 at 17:14 UTC | |
by MidLifeXis (Monsignor) on Oct 19, 2009 at 17:45 UTC |