Product knowledge · Beginner · Request anatomy

A URL is not a route pattern.

Separate every request component to see where Core parses and preserves wire facts, and where the application decodes, validates and assigns business meaning.

01 · One concrete request

Split the request into independent parts

GET http://127.0.0.1:8080/orders/A%2FB?tag=one&flag&tag=&tag=two#receipt
    └── scheme + authority ──┘ └ path ┘ └──────── query ────────┘ └ browser fragment

route declaration: GET /orders/{id}
wire request target: /orders/A%2FB?tag=one&flag&tag=&tag=two
captured id: A%2FB

Client URL

Scheme, authority, path and query belong in a browser, curl or client. A fragment stays in the browser.

Listener

Bind address plus port is startup configuration, not a route declaration.

Method

Both route and request have a method; comparison is case-sensitive under the contract.

Request target

Core parses path/query, enforces bounds and projects facts through the connector.

02 · Route declaration

A route selects a handler by method + path pattern

PatternMeaning
/Exact root.
/healthExact static path.
/orders/{id}One nonempty whole-segment capture.
/orders/{orderId}/items/{itemId}Two captures in path order.
/orders/{id}/Trailing slash is part of the pattern.

Do not declare a full URL, query template, Express :id, regex, optional segment or catch-all *. Static segments win at the earliest differing position; ambiguous same-structure patterns are rejected rather than resolved by registration order.

03 · Path and captures

Encoded does not mean decoded text

/items/a%2Fb
The capture is a%2Fb; the encoded slash remains within one segment because boundaries are found before decoding.
/users vs /users/
Distinct paths; never assume a framework redirect.
Application step
Explicitly percent-decode, validate UTF-8, parse the business type and enforce policy.
Never
Do not decode a capture and feed it back into routing; string conversion is not percent decoding.

04 · Ordered query entries

Presence and order are data

Wire inputMeaning
no flagKey absent.
?flagKey present, value absent.
?flag=Key present, empty value.
?tag=one&tag=twoTwo ordered entries, not one overwritten map value.
?q=a+bEncoded value retains +; no implicit form-style space conversion.
?q=a%26bOne value containing encoded &.

Query does not select another route. The handler owns business behavior; use the client's URL encoder instead of concatenating untrusted text.

05 · Headers

Lookup is case-insensitive; values are not necessarily a map

Name

Content-Type and content-type identify the same header name.

Duplicates

Use ordered/all-values views where duplicates matter; never collapse values the connector preserves.

Bounds

Core checks count and bytes before application use. A limit can fail before the handler.

Safety

Never reflect arbitrary inbound headers, cookies, authorization or credentials into responses or logs.

06 · Body and trailers

Payload bytes do not become JSON automatically

Buffered body
Complete bounded bytes projected by the connector; application owns media type, decoder, schema and business validation.
Streaming body
Chunks, pressure, cancellation and borrowed lifetime have a separate Advanced contract.
Trailers
Fields arrive after body data and EOF; never read them as initial headers or before the stream finishes.
Response
Application chooses status, headers and body; Core owns framing. Do not hand-write Content-Length or Transfer-Encoding.

07 · Building outbound intent

A route pattern is not an outbound path

logical target: billing.api
connection endpoint: 10.0.2.15:8443
HTTP authority / TLS identity: billing.internal
method: POST
origin-form target: /charges/customer-7?notify=true
deadline: finite

wrong: /charges/{customerId}
wrong: https://billing.internal/charges/... in a path/query-only field

Connection destination, HTTP authority and TLS peer identity are separate settings. Successful submit means admitted only; consume the matching terminal to distinguish an HTTP 4xx/5xx response from cancellation, deadline or transport failure. Retry and idempotency remain application policy.

08 · Request checklist

Before choosing language syntax