users@jersey.java.net

Re: [Jersey] client authorization?

From: Martin Probst <mail_at_martin-probst.com>
Date: Fri, 10 Jul 2009 10:30:20 +0200

It works for me like this:

resource.header(HttpHeaders.AUTHORIZATION, "Basic "
        + new String(Base64.encode("user:password"),
Charset.forName("ASCII"))).get(...);

Note that the header call returns a new object that you have to use,
it doesn't seem to modify the existing one.

There is also HTTPBasicAuthFilter but that had a bug that was only
recently fixed on trunk.

Martin

On Fri, Jul 10, 2009 at 10:26, Bill de hOra<bill_at_dehora.net> wrote:
> Is there a way to set an Authorization header using the jersey client? I
> using the WebResource.header() call, but it doesn't appear to get sent
>
> Bill
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>