$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