Dave, Have a look at the the following example: http://cvs.apache.org/viewcvs.cgi/*checkout*/jakarta-commons/httpclient/src/examples/FormLoginDemo.java?rev=1.1&only_with_tag=HTTPCLIENT_2_0_BRANCH
For more detailed information refer to the Javadoc of the HttpState class and the CookieSpec interface. Hope this helps a bit. http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/HttpState.html http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/cookie/CookieSpec.html http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/cookie/RFC2109Spec.html Oleg On Mon, 2003-11-03 at 22:37, D Alvarado wrote: > Hello, > I was wondering how to use HttpClient classes > and methods to get the value of a cookie. I want > to fetch the cookie named "SessionID". How would > I do that? This is the code I have so far ... > > PostMethod method = new PostMethod(url); > method.setFollowRedirects(true); > > NameValuePair[] data = { > new NameValuePair("user", "joe"), > new NameValuePair("password", "bloggs") > }; > method.setRequestBody(data); > > // execute request. > > // read response > > String sessionId = ??? > > // Release the connection. > method.releaseConnection(); > > > Thanks for all help, Dave > > > Care2 make the world greener! > Help the planet each day! It's free and easy: > http://www.Care2.com/dailyaction/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]