From: Ashutosh S. <ash...@gm...> - 2014-05-29 03:28:22
|
Is it what you are looking for: webClient.getCookieManager().setCookiesEnabled(true); ? On Wed, May 28, 2014 at 8:04 PM, bobiy <bo...@fo...> wrote: > hi,dear Ahmed,thank you for your reply,I have clear all cookie after the first request ,but it didn't work. > > It't default COOKIE_POLICY of HtmlUnit is BROWSER_COMPATIBILITY ? > > And i want to setting cookies as a single request header on the new version HtmlUnit,how could i do? > > I have got one answer:"DefaultHttpParams.getDefaultParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true);" But it doesn't fit the new version 2.14 of HtmlUnit any more. > > or is it default have seted single request header? or can you get me some examples? thank's very much! > > I also found a patch here http://sourceforge.net/p/htmlunit/feature-requests/72/ describing the problem but the patch itself never made it into htmlunit's build. > > > *[Htmlunit-user] i want to set cookies as a single request header, can you help me <http://sourceforge.net/p/htmlunit/mailman/message/32388405/>* > From: bobiy <bobiy@fo...> - 2014-05-28 03:13:48 > *Attachments:* Message as HTML <http://sourceforge.net/p/htmlunit/mailman/attachment/tencent_31075E843209CB6746237609%40qq.com/1/> > > Hi, > > There is webClient.getCookieManager(), where you control all cookies. > > You can clear all after the first request. > > However, it is always best to compare the HtmlUnit headers with real browsers. > > You can configure headers logging in log4j.properties [1] > > Hope that helps, > Ahmed > > > [1] http://sourceforge.net/p/htmlunit/code/HEAD/tree/trunk/htmlunit/src/test/resources/log4j.properties > > > ________________________________ > From: bobiy <bobiy@...> > To: htmlunit-user <htmlunit-user@...> > Sent: Wednesday, May 28, 2014 5:13 AM > Subject: [Htmlunit-user] i want to set cookies as a single request header, can you help me > > > > hi,i don't know how to set cookies as a single request header,can you help me? thank you very much. > reason: > A web app that I'm trying to get with htmlunit but it doesn't work. > when i browse the web app on ie first,then try to use htmlunit to get the web,it can works. > ------------------------------------------------------------------------------ > Time is money. Stop wasting it! Get your web API in 5 minutes. > http://www.restlet.com/downloadhttp://p.sf.net/sfu/restlet > _______________________________________________ > Htmlunit-user mailing list > Htmlunit-user@...https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > *[Htmlunit-user] i want to set cookies as a single request header, can > you help me <http://sourceforge.net/p/htmlunit/mailman/message/32388405/>* > From: bobiy <bobiy@fo...> - 2014-05-28 03:13:48 > *Attachments:* Message as HTML<http://sourceforge.net/p/htmlunit/mailman/attachment/tencent_31075E843209CB6746237609%40qq.com/1/> > > > hi,i don't know how to set cookies as a single request header,can you help me? thank you very much. > reason: > A web app that I'm trying to get with htmlunit but it doesn't work. > when i browse the web app on ie first,then try to use htmlunit to get the web,it can works. > > > > ------------------------------------------------------------------------------ > Time is money. Stop wasting it! Get your web API in 5 minutes. > www.restlet.com/download > http://p.sf.net/sfu/restlet > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > -- With best Regards: Ashutosh Sharma |