Book Image

RESTful Java Web Services, Second Edition

Book Image

RESTful Java Web Services, Second Edition

Overview of this book

Table of Contents (17 chapters)
RESTful Java Web Services Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Client APIs for accessing RESTful web services


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.

Specifying a dependency of the JAX-RS client API

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...