Java Reference
In-Depth Information
Developing REST-based web services
JAX-RS 2.0 (JSR-339 can be found at ) is a JCP spe-
cification that provides a Java API for RESTful web services in the HTTP protocol. It is a
major refresh from the old Version 1.1. Some of the new features are the client API,
HATEOAS support, and asynchronous calls.
In their simplest form, RESTful web services are networked applications that manipulate
the state of system resources. In this context, resource manipulation means resource cre-
ation, retrieval, updatation, and deletion (CRUD). However, RESTful web services are not
limited to just these four basic data manipulation concepts. On the contrary, RESTful web
services can execute logic at the server level but remember that every result must be a re-
source representation of the domain.
The main difference with SOAP web services is that REST asks developers to use HTTP
methods explicitly and in a way that's consistent with the protocol definition. This basic
REST design principle establishes a one-to-one mapping between CRUD operations and
HTTP methods.
Therefore, with the delineated roles for resources and representations, we can now map our
CRUD actions to the HTTP methods POST , GET , PUT , and DELETE as follows:
HTTP protocol equivalent
Search WWH ::

Custom Search