What Is a REST API? Principles Explained Simply

REST is an architectural style for web APIs built around resources, standard HTTP methods, and stateless requests. Learn its core principles with examples.

Published September 20, 2026

A REST API exposes resources (users, orders) at URLs and uses standard HTTP methods to act on them. It is stateless, so every request carries everything the server needs.

The concept

Resources are nouns in the URL (/users/7); the HTTP method is the verb: GET reads, POST creates, PUT or PATCH updates, DELETE removes.

Core principles: client–server separation, statelessness, a uniform interface, cacheable responses and representations such as JSON. Status codes tell the client what happened.

CRUD to HTTP

Create POST /users → 201 Created
Read GET /users/7 → 200 OK
Update PATCH /users/7 → 200 OK
Delete DELETE /users/7 → 204 No Content

Practical examples

A request

curl -X POST https://api.example.com/users \
  -H 'Content-Type: application/json' \
  -d '{"name":"Ada"}'

A response

HTTP/1.1 201 Created
Location: /users/7
Content-Type: application/json

{"id":7,"name":"Ada"}

Nested resources and filtering

GET /users/7/orders?status=paid&page=2

Common mistakes

  • Verbs in URLs like /getUser.
  • Returning 200 with an error body.
  • Storing session state on the server instead of using tokens.
  • Ignoring pagination on list endpoints.

Key takeaways

  • Nouns for URLs, HTTP verbs for actions.
  • Stateless requests.
  • Use correct status codes.

FAQ

REST vs GraphQL?

REST uses many fixed endpoints; GraphQL exposes one endpoint where the client chooses fields.

Must REST use JSON?

No, but JSON is the common choice.

More HTTP articles