An overview of REST
REST, or Representational State Transfer, is a way to create internet-based services, known as web services or web APIs, that commonly use HTTP as their transport protocol. It allows the well-known HTTP specifications to be reused instead of recreating new ways of exchanging data. For example, returning an HTTP status code 200 OK indicates success, while 400 Bad Request indicates failure.
In a nutshell, we can state the following:
- Each HTTP endpoint is a resource.
- Each resource can be secured independently.
- Calling the same resource twice should result in the same operation executed twice.
For example, executing two
POST /entities
should result in two new entities, while fetchingGET /entities/some-id
should return the same entity twice. - The service should be stateless, meaning that it does not persist information about the client between requests.
- The response from a RESTful service should be cacheable; you should be able to control that...