hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fran├žois-Xavier Bonnet <francois-xavier.bon...@centraliens.net>
Subject Re: HttpParams in HttpClient 4.3-alpha1
Date Mon, 11 Feb 2013 15:54:08 GMT
My test is:

         HttpClient httpClient = new DefaultHttpClient();
         HttpUriRequest request = new HttpGet(
                 "http://localhost:8080/");
         request.getParams().setParameter(ClientPNames.COOKIE_POLICY,
                 CookiePolicy.BROWSER_COMPATIBILITY);
         HttpResponse response = httpClient.execute(request);

In HttpClient 4.2.3 BrowserCompatSpec is used but in 4.3 it is BestMatchSpec

HttpClientParamConfig is used only if I build my HttpClient the new way 
(using HttpClientBuilder).

Do we consider it as a bug?

On 11/02/2013 14:12, olegk@apache.org wrote:
> On Mon, 2013-02-11 at 13:45 +0100, Fran├žois-Xavier Bonnet wrote:
>> Hello,
>>
>> I am currently migrating a project from 4.2.3 to 4.3-alpha1
>>
>> For cookies I am using BrowserCompatSpec this way:
>> httpRequest.getParams().setParameter(ClientPNames.COOKIE_POLICY,
>> CookiePolicy.BROWSER_COMPATIBILITY);
>>
>> But now it looks like this parameter is just ignored.
>>
>> I know HttpParams are deprecated and I will fix my code but isn't 4.3
>> version supposed to be compatible with 4.2.3 ?
>>
>> Regards,
>> Francois-Xavier Bonnet
>>
> There is an attribute in RequestConfig that represents a name of cookie
> policy to be used during request execution.
>
> http://hc.apache.org/httpcomponents-client-dev/httpclient/apidocs/org/apache/http/client/config/RequestConfig.html#getCookieSpec%28%29
>
> If it has no effect, it is a bug.
>
> There is also a utility class that generates RequestConfig from
> HttpParam used internally by HttpClient to provide backward
> compatibility for deprecated functionality. It _should_ pick up cookie
> spec from HttpParam.
>
> http://hc.apache.org/httpcomponents-client-dev/httpclient/apidocs/org/apache/http/client/params/HttpClientParamConfig.html#getRequestConfig%28org.apache.http.params.HttpParams%29
>
> Oleg
>
>


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


Mime
View raw message