Definition

REST is an architectural style for network-based software that requires stateless, cacheable, client-server communication via a uniform interface between software components. REST is more a set of architectural principles than a protocol or standard like SOAP. The set of guidelines can be implemented as needed, making REST APIs lightweight, flexible, and widely-used. Since data is not tied to methods and resources, REST can handle multiple types of requests and returns different data formats.

With REST, data and functionality are considered resources. Any information or object that can be named can be a resource: a document or an image, or a collection of other resources. Particular resources involved in an interaction between software components are identified with Uniform Resource Identifiers (URIs). The resources are acted upon by using a set of simple, well-defined operations. Clients and servers exchange representations of resources by using a standardized interface and protocol – typically HTTP. The content of the resources can be accessed in various formats, such as HTML, XML, YAML, JSON, and on.

RESTful

A system is called RESTful if it follows some basic principles:

Client-server communication

Client-server architectures with distinct separation of requests. Clients send requests to retrieve or modify resources, and servers send responses to these requests. Each component can evolve independently.

Stateless

Each client request to the server is stateless and can be made independently. The server must be able to completely understand the client request without using any server context or server session state. A request must contain all required information. Each request is separate and unconnected.

Cacheable

Data should be cacheable and response data marked as cacheable or not-cachable. Any data marked as cacheable may be reused as the response to the same subsequent request. Caching is done on the client side.

Uniform interface

All components must interact through a single uniform interface. The uniform interface lets the client talk to the server in a single language, independent of the architectural backend of either. This interface should provide an unchanging, standardized mean of communicating between the client and the server. Interaction with different services is therefore very simple. Implementation changes can be made in isolation and component interaction remains unchanged. 

Layered system – The layered system means that architecture is composed of hierarchical layers. Component behavior is constrained such that each component cannot “see” beyond the immediate layer with which they are interacting.

Acronym

Representational State Transfer