htmlunit cookie/refer question -


testing out java htmlunit lib. trying figure out if there's way set/delete cookie file (cookiejar) used webclient object..

i've searched multiple docs, htmlunit api no luck, i'm assuming i'm missing something.

also, there way see headers (request/respnse/referer) being xfered between client/server during testing...

thanks

tom

you can use webclient.getcookiemanager(), , can subclass httpwebconnection as:

    webclient.setwebconnection(new httpwebconnection(webclient) {         public webresponse getresponse(webrequestsettings settings) throws ioexception {             system.out.println(settings.geturl());             return super.getresponse(settings);         }     }); 

Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -