hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florent Georges <li...@fgeorges.org>
Subject Re: Scope of credentials: the request instead of client
Date Sun, 01 Mar 2009 16:43:22 GMT

Oleg Kalnichevski wrote:
> Florent Georges wrote:


> >   I use client.getCredentialsProvider() to set credentials
> > for Basic or Digest authentication.  So for now, the scope of
> > the credential settings are the Http Client.  But I would
> > like they have the scope of one single request instead.  Is
> > it possible?

> You can create a new local context for each request and bind an
> instance specific CredentialsProvider to it.

  Thanks for the answer.  Actually, in between, I used the other
way around.  The credentials must be set for one single request,
and cookies must survive among several requests, so I create one
CookieStore and instantiate a new HTTP client for each request
(each one bound to the same cookie store.)

  Is there a big difference between this approach and what you
suggested (if I am right, using the same client but a different
context for each request) ?  Are there any other info that would
be shared using the same client?  What I like in my approach is
that I control exactly what is shared between every requests,
instead of declaring what shouldn't be shared...


Florent Georges


To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

View raw message