REST Introduction
RESTful web services are HTTP-centric and make the most of this very rich protocol. In the REST architectural style, every piece of information is a resource, and these resources are addressed using Uniform Resource Identifiers (URIs), typically links on the Web. The resources are acted on by using a set of simple, well-defined operations. The REST client-server architectural style is designed to exchange representations of these resources using a defined interface and protocol. These principles encourage RESTful applications to be simple and lightweight, and to have high performance.
HTTP is the uniform interface of RESTful web services.
RESTful web services have a uniform interface (HTTP methods and URIs), so, once you know where the resource is (URI), you can invoke the HTTP method (GET, POST, etc.).
REST is statelessness, which means that every HTTP request happens in complete isolation, as the server should never keep track of requests that were executed before.
Statelessness comes with many advantages such as better scalability: no session information to handle, no need to route subsequent requests to the same server (load-balancing), failure handling (e.g., service interruptions), and so on. If you need to keep state, the client has to do extra work to store it.
Use POST to create a book resource (passing XML, JSON, or any other format) with the URI http://www.hellolibrary.com/book/. Once created, the response sends back the URI of the new resource: http://www.hellolibrary.com/book/112233.
Use GET to read the resource (and possible links to other resources from the entity body) at
http://www.hellolibrary.com/book/112233.
Use PUT on data to update the book resource at http://www.hellolibrary.com/book/112233.
Use DELETE to delete the resource at http://www.hellolibrary.com/book/112233.
While SOAP-based services rely on WSDL to describe the format of possible requests for a given web service, Web Application Description Language (WADL) is used to expose the possible interactions with a given RESTful web service.
REST applications rely heavily on many other standards:
•HTTP
•URI, URL
•XML, JSON, HTML, GIF, JPEG, and so forth (resource representations)
The Java side has been specified through JAX-RS (Java API for RESTful Web Services), but REST is like a design pattern: a reusable solution to a common problem that can be implemented by several languages.
Ref : Beginning of JavaEE 7