What is REST and what are its core principles?

Beginner

Answer

REST (Representational State Transfer) is an architectural style for designing networked applications. The core principles are:

  • Stateless: Each request contains all information needed to process it
  • Client-Server: Separation of concerns between client and server
  • Cacheable: Responses should be cacheable when appropriate
  • Uniform Interface: Consistent way to interact with resources
  • Layered System: Architecture can be composed of hierarchical layers
  • Code on Demand (optional): Server can send executable code to client

REST uses resources identified by URIs and standard HTTP methods to perform operations.