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 Subhash Chandran <su...@gmail.com> on 2008/07/27 19:52:57 UTC

Specifying HTTP version in HTTP Client (without using HttpProtocolParams's static methods)

Hi.

How do I specify the HTTP version to use in HTTP Client? The example
in the site uses static methods in:

org.apache.http.params.HttpProtocolParams

I do not want to control this parameter using static method, because
my application needs to support concurrent requests with different
HTTP versions.

--
Regards,
Subhash Chandran S

http://rest-client.googlecode.com/

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


Re: Specifying HTTP version in HTTP Client (without using HttpProtocolParams's static methods)

Posted by Oleg Kalnichevski <ol...@apache.org>.
Subhash Chandran wrote:
> Hi.
>
> How do I specify the HTTP version to use in HTTP Client? 

params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, version);



> The example
> in the site uses static methods in:
>
> org.apache.http.params.HttpProtocolParams
>
> I do not want to control this parameter using static method, because
> my application needs to support concurrent requests with different
> HTTP versions.
>
>   
These static methods are perfectly threading safe as they are not using 
any static variables. They are merely utility methods.

You can also set different protocol versions on the per request basis by 
using HttpParams collection of the respective request objects.

Oleg


> --
> Regards,
> Subhash Chandran S
>
> http://rest-client.googlecode.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>   


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