File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Looking For A HTTP Client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Looking For A HTTP Client" Watch "Looking For A HTTP Client" New topic

Looking For A HTTP Client

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
I know both HttpUnit and HttpClient can be used as a http client to fetch response from other web sites. What's the difference between them and which one is prefered if I am using them in my servlet code to retrieve info from 3rd party servers.
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3640
HttpUnit is meant for testing purpose.
Automates website testing, including form submission, JavaScript, basic http authentication, cookies and automatic page redirection, and allows Java test ...

HttpClient is meant for building application that interact with other application using Http protocol.
the HttpClient component may be of interest to anyone building HTTP-aware client applications such as web browsers, web service clients, or systems that leverage or extend the HTTP protocol for distributed communication.

You should use HttpClient for yout requirment.
[ October 11, 2006: Message edited by: Chetan Parekh ]

My blood is tested +ve for Java.
I agree. Here's the link:
subject: Looking For A HTTP Client
It's not a secret anymore!