The brand new client API is one of the most significant features introduced in JAX-RS 2/Java EE 7. The API has many uses such as unit/integration testing, system-to-system/M2M communication, Java SE/AWT/Swing/JavaFX REST clients and so on. Indeed you can think of the JAX-RS 2 client API as a general purpose replacement to java.net.URL/URLConnection for any HTTP communication. In an excellent recent blog post, Micha Kop introduces the major features of the JAX-RS 2 client API in an example driven fashion. He demonstrates doing a basic POST/GET/DELETE request, JSON support, resolving path parameters, asynchronous processing, invocation callbacks, delayed invocation, filters and much more (all with running examples included!). JAX-RS 2 specification leads Santiago Pericas-Geertsen and Marek Potociar also spent a great deal of time on the client API during their JavaOne 2013 talk (video embedded below).
The JAX-RS 2 Client API by Example
Join the DZone community and get the full member experience.Join For Free
Microservices! They are everywhere, or at least, the term is. When should you use a microservice architecture? What factors should be considered when making that decision? Do the benefits outweigh the costs? Why is everyone so excited about them, anyway? Brought to you in partnership with IBM.
Published at DZone with permission of Reza Rahman, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.