What is a RESTful API's uniform interface constraint?
Answer
The uniform interface constraint is the central distinguishing feature of REST. It has four sub-constraints. Resource identification: resources are identified by stable URIs (e.g., /users/42) — the URI identifies the concept, not a specific representation. Manipulation through representations: clients interact with resources by sending representations (JSON bodies) — the server's internal implementation is hidden. Self-descriptive messages: each request/response includes enough metadata (Content-Type, Authorization, status code) to describe how to process it. HATEOAS: responses include links to related actions the client can take next. The uniform interface simplifies the overall system architecture by decoupling client from server and enabling each to evolve independently.
More REST API Design Questions
View all →- Beginner What is REST and what are its six architectural constraints?
- Beginner What are the main HTTP methods used in REST APIs and what do they do?
- Beginner What is idempotency and which HTTP methods are idempotent?
- Beginner What are the most important HTTP status codes in REST APIs?
- Beginner What are REST resource naming conventions?