On Feb 17, 8:48 pm, "peggy" <[email protected]> wrote:
> HI, everyone
>
>       does anyone know how to use readUrl to pass HTTP basic authentication
> ? or any other ideas?
>
> thanks.

You can use java.net.Authenticator and
java.net.PasswordAuthentication, so if you execute:

Authenticator.setDefault(new Authenticator({
  'getPasswordAuthentication': function() {
    return new PasswordAuthentication('my username', 'my
password'.split(''))
  }
}));

*before* you do your call to readUrl you should be good.

HTH,
Raphael
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to