What is REST actually?
REST is about creating representation(like JSON or XML or any other format.) of object's current state(like data in database) and transferring that representation over network. Rest is the set of constraint/convention.
Resources are decoupled from their representation so that their content can be accessed in a variety of formats, such as HTML, XML, plain text, PDF, JPEG, JSON, and others. Metadata about the resource is available and used, for example, to control caching, detect transmission errors, negotiate the appropriate representation format, and perform authentication or access control
At ground level , Rest is nothing more but a collection of principles
Resources are decoupled from their representation so that their content can be accessed in a variety of formats, such as HTML, XML, plain text, PDF, JPEG, JSON, and others. Metadata about the resource is available and used, for example, to control caching, detect transmission errors, negotiate the appropriate representation format, and perform authentication or access control
At ground level , Rest is nothing more but a collection of principles
- Communication should be stateless : Server should not store any state . If required it should be part of message
- State should be representational : Internally resource at server can be in one form but it should be able
- to change it representation. An object referenced by one URI can have different formats available. Different platforms need different formats. Mobile may need JSON whereas desktop may need XML
- . HTTP verbs like GET, POST, PUT, and DELETE must be followed religiously.
- . Resources should be addressable : Every resource on your network should have an specific address(specific URI)
REST vs HTTP (From )
The most significant constraints of REST that distinguish a RESTful application from just any HTTP application are :
- Self-description : This constraint requires a RESTful request to be completely self descriptive in the users intent. This allows clients/proxies/caches to act on the message safely.
- HATEOAS(Hypermedia as the Engine of Application State ) : This constraint is about turning your application into a web of links where the client's current state is based on its place in that web. It is a tricky concept and requires more time to explain than I have right now.
This is my doubt could you please help
ReplyDeletehttps://stackoverflow.com/questions/62612122/in-representational-state-transfer-what-does-state-transfer-exactly-mean