If I want to use Java to create a REST client, what should I use?
Can i use CXF?
If I want to use Java to create a REST client, what should I use?
Can i use CXF?
I've had success using HttpClient from Jakarta Commons.
Also Java comes with URLConnection but you might want to look at this comparison with HttpClient.
Apache CXF does support REST clients (see here) but seems like overkill (CXF is a general 'services' framework and therefore complicated with support for CORBA, SOAP etc.)
There is a Jersey client API that allows you to easily implement clients in Java
I used Restlet. I really liked it and wrote a blog post about my experience.
imo there is hardly a need for a framework, simply use the servlet API and implement the request methods you need aka POST / GET / PUT / DELETE / HEAD
an example: http://www.exampledepot.com/egs/javax.servlet/com_mycompany_MyServlet.html
I think it really depends on the app and your environment, but I find resteasy really easy (since it is so declarative) and configurable. See chapter 30 for the client documentation.
Use HTTP4e REST client add-on for Eclipse. It is simple to use and has Java/C#/Ruby/Flex/ActionScript/etc.. one click code generation.