REST (REpresentational State Transfer) is a software architectural style that defines a set of constraints to be used for creating Web services.
Web services that conform to the REST architectural style is called RESTful Web services.
REST based servicesfollow some of the principles and not all
RESTFUL servicesmeans it follows all the above principles.
Here is a summary of the constraints.
- Client-server – REST applications have a server that manages application data and state. The server communicates with a client that handles the user interactions. A clear separation of concerns divides the two components. This means you can update and improve them in independent tracks.
- Stateless – servers don’t maintain any client state. Clients manage their application state. Their requests to servers contain all the information required to process them.
- Cacheable – servers must mark their responses as cacheable or not. So, infrastructures and clients can cache them when possible to improve performance. They can dispose of non-cacheable Information, so no client uses stale data.
- Uniform interface – this constraint is REST’s most well known feature or rule, depending on who you ask. Fielding says “The central feature that distinguishes the REST architectural style from other network-based styles is its emphasis on a uniform interface between components.” REST services provide data as resources, with a consistent namespace. We’ll cover this in detail below.
- Layered system – components in the system cannot “see” beyond their layer. So, you can easily add load-balancers and proxies to improve security or performance.
A RESTful service is more than a web server that exchanges JSON, or any other, documents. These constraints work together to create a very specific type of application.
REST (REpresentational State Transfer) is basically an architectural style of development having some principles:
- It should be stateless
- It should access all the resources from the server using only URI
- It does not have inbuilt encryption
- It does not have session
- It uses one and only one protocol – HTTP
- For performing CRUD operations, it should use HTTP verbs such as
- It should return the result only in the form of JSON or XML, atom, OData etc. (lightweight data )
REST based services follow some of the above principles and not all
RESTFUL services means it follows all the above principles.