On Wed, 2012-06-20 at 09:02 -0700, Yan Cheng CHEOK wrote:
> Previously, I have the following code in httpclient3
>
>
> // To prevent cookie warnings.
> httpClient.getParams().setParameter("http.protocol.single-cookie-header",
> true);
> httpClient.getParams().setCookiePolicy(org.apache.commons.httpclient.cookie.CookiePolicy.BROWSER_COMPATIBILITY);
>
>
> I was wondering, what is the equivalent code in httpclient4, as I am getting
> error in the 2nd line.
>
>
> // To prevent cookie warnings.
> httpClient.getParams().setParameter("http.protocol.single-cookie-header",
> true);
> // ??? compilation error in this line.
> // org.apache.commons.httpclient cannot be resolved to a variable
> httpClient.getParams().setCookiePolicy(org.apache.commons.httpclient.cookie.CookiePolicy.BROWSER_COMPATIBILITY);
>
>
> Thanks.
>
HttpClient 4.x can automatically pick up the best cookie policy based on
the cookie version and composition of the HTTP cookie headers. You
probably should use the default policy unless you have a strong reason
to force the use of browser compatibility policy for all cookie
versions / types.
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]