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 10:11:06 GMT
Look at the examples again. Specifically example 3.7, where
setCookieStore is used. You'll note that the httpClient variable is
declared with the type DefaultHttpClient (on the left hand side). Your
code below is not doing this (you're assigning to a variable of type
HttpClient, which is an interface that doesn't have the setCookieStore
method).

So you should change your code to use:

DefaultHttpClient httpClient = new DefaultHttpClient();

Thanks,

Sam



On 17 April 2012 11:01, tommmmmm <tommmmmm@gmail.com> wrote:
> On 17 April 2012 11:56, Sam Crawford <samcrawford@gmail.com> wrote:
>
>> 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.
>>
>>
>  HttpClient httpClient = new DefaultHttpClient();
>
> and I've printed my classpath just to be 100% sure - there is this line:
>
>   -
>   jar:file:/home/min/ucng/javaLibs/httpcomponents-client-4.1.3/lib/httpclient-4.1.3.jar
>
>
> I also tried typing the method manually in case Netbeans just doesn't see
> it. Got compilation error symbol not found, so getCookieStore really isn't
> there.
>
> I also tried calling getCookieStore as a static method
> HttpClient.getCookieStore(). Also didn't work.

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