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: How to get cookies that are about to be sent?
Date Tue, 17 Apr 2012 09:56:59 GMT
It is there... I suspect you may not be using the DefaultHttpClient
class. This has methods for both setCookieStore and getCookieStore.
I've just checked the source for 4.1.3, it's certainly there.

Sam


On 17 April 2012 10:47, tommmmmm <tommmmmm@gmail.com> wrote:
> On 17 April 2012 11:38, Sam Crawford <samcrawford@gmail.com> wrote:
>
>> Look at the last example (section 3.9) on the page you referenced
>> (
>> http://hc.apache.org/httpcomponents-client-ga/tutorial/html/statemgmt.html
>> )
>>
>> You can retrieve the CookieStore later using:
>>
>> CookieStore store = localContext.getAttribute(ClientContext.COOKIE_STORE);
>>
>>
>>
> But it requires me to add localContext to EACH http.execute method.
> And I won't search for 20+ executions scattered in 3 files.
>
> You solution is exactly what I don't want to do.
> Even without saving the cookies to some separate place HttpClient knows
> what to send, so it must be storing the cookies somewhere. The question is
> where....

---------------------------------------------------------------------
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