What is REST?

REST (Representational State Transfer) is an architectural style for designing networked applications. It’s not a protocol or a standard, but rather a set of principles that use HTTP to perform CRUD operations (Create, Read, Update, Delete) on resources.

Why REST?

REST became popular because it’s simple, stateless, and leverages existing HTTP methods like GET, POST, PUT, DELETE.

Think of REST like a restaurant:

  • You (client) place an order (request)
  • The kitchen (server) prepares the food (response)
  • You don’t need to know how they made it; you just get the result

Core Principles

  • Stateless: Each request contains all necessary information. Server doesn’t store session.
  • Client-Server: Decouples frontend and backend.
  • Cacheable: Improves performance by caching responses.
  • Uniform Interface: Resources are accessed via standard URIs and HTTP methods.
  • Layered System: Architecture can have multiple layers (like proxies, gateways).

HTTP Methods

MethodAction
GETRead
POSTCreate
PUTUpdate
DELETEDelete

Example

GET /users/123

This fetches user with ID 123.

REST vs SOAP

  • REST is lightweight, easy to use with JSON, and uses HTTP.
  • SOAP is heavier, uses XML, and has stricter standards.

Common Use Cases

  • Backend for web/mobile apps
  • IoT systems
  • Integration between microservices

Conclusion

REST is a foundational concept for developers working with APIs. It’s simple, scalable, and fits naturally with the web. Whether you’re building a microservice or a frontend talking to a backend — knowing REST is a must.

→ Learn more: