The JAX-RS 2 Client API by Example

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 official Java EE 7 tutorial also has a great section on the JAX-RS 2 client API, as does the docs for the Jersey JAX-RS 2 reference implementation.

Comments:

Post a Comment:
Comments are closed for this entry.