There are many frameworks available for building a Java client for accessing REST. The JAX-RS specification standardizes the client APIs and provides fluent APIs for interaction with the RESTful web service.
Tip
Fluent APIs allow you to chain method calls to perform the desired operation, which improves the readability of the code. The return value of the called method gives a context for the next call and is terminated through the return of a void. You can learn more about the fluent APIs at https://en.wikipedia.org/wiki/Fluent_interface.
To use the client part of the JAX-RS specification, the client application needs to depend only on the client part of the JAX-RS libraries. If you use the Jersey implementation, the dependency entry in pom.xml
may look like the following:
<dependency> <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-client</artifactId...