REST is an architectural style consisting of a coordinated set of architectural constraints applied to
The term representational state transfer was introduced and defined in 2000 by Roy Fielding in his doctoral dissertation at UC Irvine.
The REST architectural style is often applied to the development of web services as an alternative to other distributed-computing specifications such as SOAP (Simple Object Access protocol).
A Web Service is a method of communication between two electronic devices over a network.
It is a software function provided at a network address over the web with the service always on as in the concept of utility computing54.1.
The W3C defines a Web service generally as:
A software system designed to support interoperable machine-to-machine interaction over a network.
Web service APIs that adhere to the architectural constraints are called RESTful.
HTTP based RESTful APIs are defined with these aspects:
The following table shows the HTTP methods that are typically used to implement a RESTful API.
RESTful API HTTP methods | ||||
Resource | GET | PUT | POST | DELETE |
Collection URI, such as http://example.com/resources |
List the URIs and perhaps other details of the collection's members. | Replace the entire collection with another collection. | Create a new entry in the collection. The new entry's URI is assigned automatically and is usually returned by the operation. | Delete the entire collection. |
Element URI, such as http://example.com/resources/item17 |
Retrieve a representation of the addressed member of the collection, expressed in an appropriate Internet media type. | Replace the addressed member of the collection, or if it doesn't exist, create it. | Not generally used. Treat the addressed member as a collection in its own right and create a new entry in it. | Delete the addressed member of the collection. |
While web browsers may show alert dialog boxes to warn users in some cases where reloading a page may re-submit a POST request, it is generally up to the web application to handle cases where a POST request should not be submitted more than once.
Unlike SOAP-based web services, there is no "official" standard for RESTful web APIs. This is because REST is an architectural style, unlike SOAP, which is a protocol.