RESTful architecture constraints

What is REST

REST or Representational State Transfer, is an architectural style for API interactions over HTTP. It is an application-level standard for the communication between the client and the server and is characterized by statelessness and clear client-server separation of concerns.

1. Client - server model

  • Seperate of concerns

2575585e.png

  • client and server don't share any code

Uniform interface

  • Client and server share a common technical interface

  • Interface:

    • Contract for communication between client-server
    • Contract has no business context
  • There are 5 guilding principles

    • Indentify of the resource (URI/URL)
    • Representation of the resource: XML, JSON, TXT
    • Self descriptive message -metadata, http headers

State management

  1. No state management in mid tier/server
  2. All calls from client are independent

Caching

0bf9100e.png

13692389.png 1461ca0c.png

4f99f573.png Actions for business domain 8fa7361d.png fbab1bdb.png booking vacation 90a60869.png

API status code

a2bcab0c.png d1ee1b44.png

438c655d.png]

bf23a9b2.png

fba2560d.png 1e940c31.png

15a1e099.png

References

https://www.udemy.com/course/rest-api/

Last updated on