Re: Using HttpUnit without WebConversation and WebResponse
Russell Gold <[email protected]>
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <[email protected]> |
On Mar 18, 2006, at 8:37 PM, Jesper Sahner wrote: > Hi! > > Normally when you use HttpUnit you use it like this: > WebConversation wc = new WebConversation(); > WebResponse resp = wc.getResponse( "http://www.httpunit.org/doc/ > cookbook.html" ); > WebTable table = resp.getTables()[0]; > ... > > Now say that you already have the response in e.g. a String (or a > Stream of some kind) and just want to use the WebTable-part. How > can the WebConversation- and the WebResponse-part be omitted and be > replaced with e.g. a String? If you can write the string to a file, you can do something like: WebResponse wr = WebResponse.newResponse( New URLConnection ( "file:path-to-the-file" ) ); ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642