You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by "Fadi M. Maali" <Fa...@samba.com> on 2008/01/21 12:52:58 UTC

can I Set accept-encoding on httpclient level?

Hi all,

 

I am using a library that in turns uses Apache HttpClient. This library
gives access to the instance of HttpClient it uses (so I was able to set
proxy,credential...)  but no access to the HttpMethod instance it uses.
The problem now is that I need to set the request header
accept-encoding. 

Is there a way to set it on the HttpClient scope and then all methods
from this instance will use this header?

 

Many thanks,

IMPORTANT NOTICE: CONFIDENTIAL AND LEGAL PRIVILEGE

This electronic communication is intended by the sender only for the access and use by the addressee and may contain legally privileged and confidential information. If you are not the addressee, you are notified that any transmission, disclosure, use, access to, storage or photocopying of this e-mail and any attachments is strictly prohibited. The legal privilege and confidentiality attached to this e-mail and any attachments is not waived, lost or destroyed by reason of a mistaken delivery to you. If you have received this e-mail and any attachments in error please immediately delete it and all copies from your system and notify the sender by e-mail. Nothing in this communication is intended to operate as an electronic signature under any applicable law...

Re: can I Set accept-encoding on httpclient level?

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2008-01-21 at 14:52 +0300, Fadi M. Maali wrote:
> Hi all,
> 
>  
> 
> I am using a library that in turns uses Apache HttpClient. This library
> gives access to the instance of HttpClient it uses (so I was able to set
> proxy,credential...)  but no access to the HttpMethod instance it uses.
> The problem now is that I need to set the request header
> accept-encoding. 
> 
> Is there a way to set it on the HttpClient scope and then all methods
> from this instance will use this header?
> 
>  

Yes, there is. Use 'http.default-headers' parameter. For details see

http://hc.apache.org/httpclient-3.x/preference-api.html

Oleg



> 
> Many thanks,
> 
> IMPORTANT NOTICE: CONFIDENTIAL AND LEGAL PRIVILEGE
> 
> This electronic communication is intended by the sender only for the access and use by the addressee and may contain legally privileged and confidential information. If you are not the addressee, you are notified that any transmission, disclosure, use, access to, storage or photocopying of this e-mail and any attachments is strictly prohibited. The legal privilege and confidentiality attached to this e-mail and any attachments is not waived, lost or destroyed by reason of a mistaken delivery to you. If you have received this e-mail and any attachments in error please immediately delete it and all copies from your system and notify the sender by e-mail. Nothing in this communication is intended to operate as an electronic signature under any applicable law...


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