File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes httpclient - commons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "httpclient - commons" Watch "httpclient - commons" New topic

httpclient - commons

friso dejonge
Ranch Hand

Joined: Jul 11, 2002
Posts: 162
i just read some articles on the commons, but i am looking specifically at the httpclient now. It looks to me like this can be used, maybe is used as some sort of testing engine like the httpunit.jar
Retrieve a webpage, and take a look at the outcome.
So my questions are:
1. can you chain pages, like filling in a form stretching over multiple pages, and then test the whole form filling procedure
2. can you use javascript in this httpclient, and use the dom-model ?

swimming certificate (A & B), shoelaces diploma, and some useless java ones.
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
The Commons HttpClient doesn't deal with the HTML/JavaScript level you're describing -- it concentrates on implementing the HTTP protocol and doing it well.
HttpUnit (and HtmlUnit, JWebUnit) on the other hand supports filling and submitting HTML forms and, to some degree, JavaScript on HTML pages.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Harshad Oak
Ranch Hand

Joined: Oct 21, 2002
Posts: 45
HttpClient is concerned with sending HTTP requests from Java code and then handling the response in Java code.
If i am not mistaken, HtmlUnit uses HttpClient.

------------------------<br />Harshad Oak<br /> <br />- Oracle ACE Director, Sun Java Champion<br /> <br />Author:<br />- Pro Jakarta Commons<br />- Oracle JDeveloper 10g: Empowering J2EE development<br />- Java 2 Enterprise Edition 1.4 Bible<br /> <br />- SCJP, SCWCD<br />------------------------
Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
I agree with Lasse Koskela and Harshad Oak, please see HttpClient features.
friso dejonge
Ranch Hand

Joined: Jul 11, 2002
Posts: 162
i get the point. thanks,
I agree. Here's the link:
subject: httpclient - commons
jQuery in Action, 3rd edition