I was trying to hack a Perl script that used LWP::UserAgent but got lost trying to figure out the parameters to the credentials attribute. The man page reads:

$ua->credentials( $netloc, $realm, $uname, $pass )
        Set the user name and password to be used for a realm. It is
        often more useful to specialize the get_basic_credentials()
        method instead.

I had no idea what $netloc represented. It would have been very helpful to me to have a short example i.e.:

$ua->credentials("example.com:80", "realm", "user", "password"); #http
$ua->credentials("example.com:443", "realm", "user", "password"); #https

Thanks,
andrew



Reply via email to