Sobes.tech
Middle

What are the rules of REST architecture that you know?

sobes.tech AI

Answer from AI

  1. Client-Server Architecture: Clear separation of responsibilities between the client requesting resources and the server providing them.
  2. Stateless: Each request from the client to the server must contain all the information needed to understand and process the request. The server does not store information about previous client requests.
  3. Cacheability: Responses from the server can be marked as cacheable or non-cacheable, allowing clients to reuse responses to improve performance.
  4. Uniform Interface: Four constraints:
    • Identification of resources: Resources are identified using URIs.
    • Manipulation of resources through representations: The client interacts with a resource through its representations.
    • Self-descriptive messages: Each message contains enough information to understand how to process it (e.g., content type).
    • HATEOAS (Hypermedia as the Engine of Application State): The client transitions between resources by following links in server responses.
  5. Layered System: The architecture allows for intermediate layers (e.g., proxies, gateways) between the client and server without affecting their interaction.
  6. Code on Demand (Optional): The server can temporarily extend or customize the client's functionality by transferring executable code (e.g., JavaScript). This is an optional constraint.
What are the rules of REST architecture that you… - sobes.tech