users@jersey.java.net

Re: [Jersey] Jersey for clients

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 09 Oct 2008 19:54:53 +0200

Hi Paul,

On Oct 9, 2008, at 7:04 PM, Paulo Cordeiro wrote:
> I need consume Rest services in my web application.
> Jersey has option in your API or the best option is use
> Apache Httpclient?
>

The Jersey Client API is very easy to use especially when you want to
send/receive information using certain Java types just like on the
server-side. I find it a lot easier to use this API, which is resource
centric rather than the Apache HTTP client which is more focused on
the request and response. However, i am biased :-)

The Jersey Client API is used extensively for testing Jersey itself as
well as the samples, which also show how to use the API.

The Apache HTTP client has probably got a lot more features, such as
around authentication. The Jersey client is currently lacking the
filters to support common cases. But it is easy to add your own filter
functionality.

The Jersey client API leverages HttpURLConnecton so it is possible to
configure the default settings for HttpURLConnecton to enable say SSL
certificates etc.

What type of functionality do you require to consume your web
applicaton?

Paul.