hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Crawford <samcrawf...@gmail.com>
Subject Re: Converting from httpclient 3 to httpclient 4 (Cookie policy)
Date Wed, 20 Jun 2012 16:28:47 GMT
See Section 3.5 of
http://hc.apache.org/httpcomponents-client-ga/tutorial/html/statemgmt.html

This includes an example setting the 'browser compatibility' cookie
policy in HttpClient 4.x.

Thanks,

Sam


On 20 June 2012 17:02, Yan Cheng CHEOK <yccheok@yahoo.com> 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.
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message