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, [email protected] 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: [email protected]
For additional commands, e-mail: [email protected]