Keep reading for FREE
Representational state transfer (REST) is a software architectural style that was created to guide the design and development of the architecture for the World Wide Web. REST defines a set of constraints for how the architecture of an Internet-scale distributed hypermedia system, such as the Web, should behave.
The REST architectural style is designed for client-server applications. The coupling between the client and the server must be as loose as possible to facilitate large-scale adoption. This is achieved by creating a layer of abstraction on the server by defining resources that encapsulate entities (e.g. files) on the server and so hiding the underlying implementation details (file server, database, etc.).
Clients can only access resources using URIs. In other words, the client requests a resource using a URI and the server responds with a representation of the resource. A representation of a resource is another important concept in REST - to ensure responses can be interpreted by the widest possible number of client applications a representation of the resource is sent in hypertext format.
The client-server design pattern enforces the separation of concerns, which helps the client and the server components evolve independently.
By separating the user interface concerns (client) from the data storage concerns (server), we improve the portability of the user interface across multiple platforms and improve scalability by simplifying the server components.
Statelessness means that no session information is retained by the server. Relevant session data is sent to the sever by the client in such a way that every packet of information transferred can be understood in isolation.
For example, in a RESTful API, making subsequent requests should be processed and fulfilled by the server without it keeping track of those requests, treating them independently.
The cacheable constraint requires that a response should implicitly or explicitly label itself as cacheable or non-cacheable.
If the response is cacheable, the client application gets the right to reuse the response data later for equivalent requests and a specified period.
The layered system style allows an architecture to be composed of hierarchical layers by constraining component behavior.
For example, in a layered system, each component cannot see beyond the immediate layer they are interacting with.
By applying the principle of generality to the components interface, we can simplify the overall system architecture and improve the visibility of interactions.
Multiple architectural constraints help in obtaining a uniform interface and guiding the behaviour of components.
The following four constraints can achieve a uniform REST interface:
reading habits, gather your
remember what you readand stay ahead of the crowd!
Save time with daily digests
No ads, all content is free
Save ideas & add your own
Get access to the mobile app
4.7 App Rating