In REST, a resource is any meaningful entity the API exposes, identified by a URI, such as /users/42 or /orders. Resources are typically nouns, and HTTP methods describe the action performed on them: GET to read, POST to create, PUT or PATCH to update, and DELETE to remove. Representing the system as a set of addressable resources, rather than remote procedure calls, is the architectural heart of REST and shapes how clients navigate the API.
2 / 5
What does idempotency mean for an HTTP method?
Idempotency means that making the same request multiple times produces the same server state as making it once. GET, PUT, and DELETE are idempotent: re-sending a DELETE for an already-removed resource leaves the state unchanged. POST usually is not, since it tends to create a new resource each time. Idempotency matters for safe retries on flaky networks, and APIs sometimes add an idempotency key to make otherwise non-idempotent operations safe to repeat.
3 / 5
What is HATEOAS in REST?
HATEOAS (Hypermedia As The Engine Of Application State) is a REST constraint where responses include links describing the actions a client can take next, rather than the client hardcoding URLs. For example, an order response might link to cancel or pay endpoints. This lets the server evolve its URI structure and guide clients dynamically, much like web pages link to other pages. Full HATEOAS is uncommon in practice, but it represents the most mature level of RESTful design.
4 / 5
What is pagination in API design?
Pagination breaks a large collection into smaller pages so clients fetch results incrementally instead of all at once, protecting both server and client from overload. Common strategies include offset-based pagination using limit and offset parameters, and cursor-based pagination that passes an opaque pointer to the next page. Cursor pagination handles changing data more reliably and scales better for large datasets. Responses typically include metadata or links to the next and previous pages so clients can navigate the collection.
5 / 5
What does an HTTP status code communicate?
An HTTP status code is a three-digit number summarizing the outcome of a request. They are grouped by leading digit: 2xx for success (such as 200 OK and 201 Created), 3xx for redirection, 4xx for client errors (like 400 Bad Request and 404 Not Found), and 5xx for server errors. Using the correct code lets clients react appropriately without parsing the body. Consistent, accurate status codes are a hallmark of a well-designed REST API.