in reply to Re^2: Basic / Digest authentication in website
in thread Basic / Digest authentication in website

Your third piece of code:

$mechanize->credentials("server:49282","Digest realm", $username=>$pas +sword);

The server's response:

WWW-Authenticate: Digest realm="GWAVA Console", ...

Do you see the important difference?

Either use the two-argument form of WWW::Mechanize->credentials() or fix the realm argument of the four-argument form to match the server's 401 response.

The second piece of code has the same problem, but you can't use the two argument form of LWP::UserAgent->credentials() (it is a getter, not a setter).

zwon explained you why the first piece of code doesn't work.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)