Representational state transfer (REST) is an architectural style for network-based applications. In a web API, clients use standard HTTP methods to access and change resources. REST offers more than a convenient set of endpoints: its guiding constraints shape how clients, servers, and responses work together. An API that uses HTTP methods with REST in mind is not necessarily fully RESTful. section 1.1.4 section 10.0
Choose the method that matches the intended operation:
- GET reads data; POST creates a resource or performs a state change. section 1.1.4
- PATCH updates an existing resource; PUT replaces one, or creates it if absent. section 1.1.4
- DELETE permanently erases a resource. section 1.1.4
For a board-game API, the design question is not just which method handles a request. Keep client UI concerns separate from server data storage, and make each request carry the context it needs, such as an authentication key, rather than relying on information retained from a previous call. These client-server and statelessness constraints help keep the parts of the system simpler to change. section 1.1.4 section 3.0
In ASP.NET Core, put the constraints to work through the API’s configuration and responses:
- Configure CORS services and middleware when a browser client must load resources from an allowed external origin. section 3.5
- Set response-caching HTTP headers, including through the [ResponseCache] attribute, when caching can reduce latency and bandwidth use. section 3.5
- Consider a response DTO containing data, structured links, and metadata so a client can discover possible next requests; this applies the uniform-interface goal through hypermedia. section 3.5
Check the resulting behavior, not just the route names: can a client make a request without relying on a previous call, and do the returned links help it decide what to do next? REST is a practical default for many APIs, but it is not always the best fit. Fixed endpoints can return more data than needed or require several round trips to gather too little; GraphQL offers client-shaped queries as one alternative. section 1.1.4 section 3.5 section 10.6





















