From: Brehm, R. P <rob...@of...> - 2005-01-13 23:05:56
|
What I was trying to do is to create cookies before connecting to the application. The below code returns a null state if try to set the cookie before invoking webClient.getPage which makes sense because there can be no connection state prior to a connection being made. Therefore cookies cannot be created beforehand. I will have to approach this from another angle. Thanks for the reply, Bob Brehm -----Original Message----- From: htm...@li... [mailto:htm...@li...]On Behalf Of Brad Clarke Sent: Thursday, January 13, 2005 10:27 AM To: htm...@li... Subject: Re: [Htmlunit-user] Cookie Support The HttpClient is hidden away on purpose. I'm not sure I exactly understand what you're doing but would this help? WebClient.getWebConnection().getStateForUrl(new URL("http://mysite.com/").addCookie(Cookie) --- "Brehm, Robert P" <rob...@of...> wrote: > All, > > I want to create a cookie and then associate it the WebConnection's state. In > order to do this I believe that I need to do this by calling HttpClient's setState > method (HttpClient is a class in commons-httpClient). I have scoured the > HtmlUnit javadocs, and I have not found any way to get a reference to HttpClient. > Any suggestions on how to create and set a cookie from HtmlUnit would be > appreciated. > > Best regards, > > Bob Brehm > Software Engineer > Xerox Corporation > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |