hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalnichevski, Oleg" <oleg.kalnichev...@bearingpoint.com>
Subject RE: [httpclient][session][how to create a session]
Date Fri, 18 Jul 2003 16:44:29 GMT
Vncent,

Have a look at the HttpState class. You can keep an instance of HttpState class in order to
preserve HTTP state information between method invocations. 


        HttpState mystate = new HttpState();
        HttpClient httpclient = new HttpClient();
        Cookie mycookie = new Cookie(".foobar.com", "mycookie", "stuff", "/", null, false);
        mystate.addCookie(mycookie);
        mystate.setCookiePolicy(CookiePolicy.RFC2109);
        httpclient.setState(mystate);

Hope this helps

Oleg

-----Original Message-----
From: vincent chappuis [mailto:vchappuis@sqli.com]
Sent: Friday, July 18, 2003 5:39 PM
To: commons-httpclient-dev@jakarta.apache.org
Subject: [httpclient][session][how to create a session]


Hi all, I'm a beginer in HttpClient.

My problem is the next one : 

How to keep a session using HttpClient API ? 

Best regards 



Mime
View raw message