Sobes.tech
Junior

Mis on REST-ile suunatud arhitektuur (ROA)?

sobes.tech AI

Vastus AI-lt

REST-oriented architecture (Representational State Transfer) is an architectural style for distributed systems based on a set of principles that define how resources are identified and how interaction occurs between client and server.

Main principles of REST:

  1. Client-Server: Separation of concerns. The client handles the user interface, the server handles data storage and processing.
  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 any state about the client between requests.
  3. Cacheable: Clients and intermediaries can cache responses to improve performance and scalability.
  4. Uniform Interface:
    • Identification of resources: Resources are identified via URLs.
    • Manipulation of resources through representations: Clients can manipulate resources using representations (e.g., JSON, XML).
    • Self-descriptive messages: Each message contains enough information to understand how to process it.
    • Hypermedia as the engine of application state (HATEOAS): Clients interact with the application solely through hypermedia provided in responses.
  5. Layered system: The system can be organized into layers (e.g., proxies, gateways), and each component only sees the next layer it interacts with.
  6. Code on demand (optional): The server can temporarily extend client functionality by transferring executable code (e.g., JavaScript).

In QA, testing REST API includes verifying compliance with these principles, as well as:

  • Functional testing (HTTP methods GET, POST, PUT, DELETE).
  • Load testing.
  • Security testing.
  • Compatibility testing (various data formats, clients).