Skip to content
ballmüllersolutions logo Send an email Call us
November 27, 2026

REST (Representational State Transfer)

REST is an architectural style for web APIs: resources have an address of their own, clients work on them with the standard methods of HTTP, and every request stands on its own, without the server keeping state between requests.

REST (representational state transfer) is an architectural style for web APIs. An API describes resources, each with an address of its own, and clients work on them with the standard methods of HTTP. Every request stands on its own; the server keeps no state between two requests.

The building blocks

Microsoft's documentation on designing RESTful web APIs names these concepts:

From this follow rules of thumb for addresses: name collections in the plural (/customers, /customers/5), keep relationships simple (at most collection/item/collection), no verbs in the address, and do not design an API as a mirror of the database tables. The method names the action: POST /api/appointments creates, DELETE /api/appointments/7 deletes.

Whether an API is "really" REST is disputed. Richardson's maturity model distinguishes four levels: one address for everything, addresses of their own per resource, HTTP methods for the operations, and finally hypermedia. Many published APIs are at about level 2. In practice, that is good enough when the API is designed cleanly.

REST in ASP.NET Core

With minimal APIs, a REST API in ASP.NET Core looks like this (the types are placeholders):

var appointments = app.MapGroup("/api/appointments");

appointments.MapGet("/{id:int}", async (int id, IAppointmentStore store) =>
    await store.FindAsync(id) is { } appointment
        ? Results.Ok(appointment)
        : Results.NotFound());

appointments.MapPost("/", async (NewAppointment input, IAppointmentStore store) =>
{
    var created = await store.AddAsync(input);
    return Results.Created($"/api/appointments/{created.Id}", created);
});

Sensible status codes, errors as ProblemDetails, and a description in the OpenAPI format belong to it. With OpenAPI, the contract can be designed first ("contract first"), and documentation and client libraries can be generated from it. For lists, paging and filters belong in the API so that answers stay small.

An example from the Kladde

The Kladde, the sample application of a small IT office, has an API for contacts and appointments. In the course, it is hardened for outside callers: a list that does not swallow an appointment while paging, two people who do not overwrite each other's changes (ETag and If-Match), and a booking that is booked only once when it arrives twice (Idempotency-Key).

Common misconceptions

In the course

You learn this in K2, module 2.12, in the lessons REST done right: resources, methods, state and Contract first: OpenAPI. You already build the first API in module 2.3 in The first web API.

Further reading on the blog

Sources