REST is Flow's default. A REST API addresses resources by URL path and acts on them with HTTP methods
(GET, POST, PUT, PATCH, DELETE); that is ordinary HTTP, so Flow carries it with no special
configuration — a route to a backend is all it takes.
New here? Start with Traffic & APIs for the overview, or Getting Started. For a complete, runnable REST config, see
examples/rest-api-gateway.kdlin Examples.
Flow reads the HTTP envelope — method, path, headers, status — and forwards the body unchanged. For each request it:
- Matches a route by path (and optionally host or header), then scores the best match. See Routing.
- Checks the method against the route's
allowed-methods; a method the route does not allow is refused. - Applies policies — authentication, rate limiting, header rewriting, size limits, caching.
- Forwards the request to the selected backend and streams the response back.
The JSON (or other) body is never parsed or validated — it passes through byte-for-byte.
route {
name "users-api"
match {
path-prefix "/api/v1/users"
}
allowed-methods "GET" "POST" "PUT" "PATCH" "DELETE"
connectors {
"users-backend.internal:8080"
}
}Each of these is owned by its own page; a REST route uses them like any other HTTP route:
| Concern | Where |
|---|---|
| Path matching, prefixes, regex, scoring | Routing |
| Allowed methods per route | Routing, Configuration |
| Request / response header rewriting | Header transform |
| Path / URI rewriting | URI transform |
| Request and response body size limits | Request size limit, Response size limit |
| Caching GET responses | Response caching |
| Redirects (HTTPS enforcement, moved paths, version moves) | Redirect |
| Error responses Flow returns (4xx / 5xx) | How Flow Behaves |
| Throughput and latency | Performance |
Flow forwards REST bodies untouched today. Deeper, REST-aware handling is on the roadmap:
Planned: request and response body transformation (bodies pass through unchanged today). See Roadmap.
Planned: request validation against an OpenAPI schema. See Roadmap.
Evaluating: gRPC transcoding — letting REST and JSON clients call gRPC backends through Flow. See Roadmap.
- Traffic & APIs — overview of everything Flow carries
- Non-REST APIs — GraphQL, JSON-RPC, gRPC, SSE, WebSocket
- Transport — HTTP versions, h2c and TLS
- Configuration Reference — full KDL syntax