What can I use to create a REST client in Java?

Possible duplicate:
Debugging clients for Java?

If I want to use Java to create a REST client, what should I use?

Can I use CXF?

+6
java rest cxf
source share
7 answers

I had success using the HttpClient from Jakarta Commons.

Java also comes with URLConnection , but you can see this comparison with HttpClient .

Apache CXF supports REST clients (see here ), but it seems redundant (CXF is a common β€œservices” structure and therefore complicated by CORBA, SOAP, etc. support)

+3
source share

There is a client client API that allows you to easily implement clients in Java

+7
source share

I used Restlet . I really liked and wrote a blog post about my experience.

+7
source share

imo is unlikely to need a framework, just use the servlet API and implement the request methods you need: POST / GET / PUT / DELETE / HEAD

Example: http://www.exampledepot.com/egs/javax.servlet/com_mycompany_MyServlet.html

0
source share

I think it really depends on the application and your environment, but I find resteasy really easy (as it is so declarative) and customizable. See chapter 30 for customer documentation.

0
source share

Use the HTTP4e REST client for Eclipse. It is easy to use and has Java / C # / Ruby / Flex / ActionScript / etc. Create one click.

0
source share

I tried to use the examples given in this ling http://cxf.apache.org/docs/jax-rs-client-api.html I ran into a problem that the interface or Impl cannot always be protected by the client side to create a proxy. I also tried wadl2java to find out if clients are generated. CXF 2.6 did not create a client class.

I am pleased with the HTTPclient call until some specific implementation changes the way the client is written.

Note. We use only CXF with Java, so we only experiment with CXF. another implementation may give different results

0
source share

All Articles