Learn VisualLearn API

REST's Three Commitments: Resource Orientation, HTTP Semantics, and Statelessness

Resource orientation means URLs name the nouns the API exposes, not actions: /orders/42, not /getOrder.

Using HTTP's own semantics means adopting the meaning the HTTP spec already defines as the API's own meaning. For example, GET means a safe operation, and 404 means the resource wasn't found. This meaning is the same across any REST API that follows the spec. So a client can understand what a method or status code means without reading documentation for this specific API.

Statelessness means each request carries everything the server needs to handle it, and the server doesn't depend on remembering the state of a previous request. Usually that is an authentication token. As a result, even with several servers, any server can handle any request.

Every lesson in this course so far has been a part of one of these three commitments.

GOAL

State REST's three core commitments — resource orientation, using HTTP's semantics, and statelessness — and recognize a violation of each.

An API always returns 200, even for errors, putting the real outcome in a status field inside the JSON body instead. Which REST commitment does this violate?