hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Scope of credentials: the request instead of client
Date Mon, 23 Feb 2009 23:01:23 GMT
Florent Georges wrote:
>   Hi,
> 
>   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?
> 
>   Regards,
> 

Florent,

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

This example shows how to bind a custom instance of CookieStore to the 
local context. You can do the same with CredentialsProvider

http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/examples/org/apache/http/examples/client/ClientCustomContext.java

Oleg

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


Mime
View raw message