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.
Product knowledge · Beginner · Request anatomy
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
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%2FBScheme, authority, path and query belong in a browser, curl or client. A fragment stays in the browser.
Bind address plus port is startup configuration, not a route declaration.
Both route and request have a method; comparison is case-sensitive under the contract.
Core parses path/query, enforces bounds and projects facts through the connector.
02 · Route declaration
| Pattern | Meaning |
|---|---|
/ | Exact root. |
/health | Exact 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
/items/a%2Fba%2Fb; the encoded slash remains within one segment because boundaries are found before decoding./users vs /users/04 · Ordered query entries
| Wire input | Meaning |
|---|---|
no flag | Key absent. |
?flag | Key present, value absent. |
?flag= | Key present, empty value. |
?tag=one&tag=two | Two ordered entries, not one overwritten map value. |
?q=a+b | Encoded value retains +; no implicit form-style space conversion. |
?q=a%26b | One 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
Content-Type and content-type identify the same header name.
Use ordered/all-values views where duplicates matter; never collapse values the connector preserves.
Core checks count and bytes before application use. A limit can fail before the handler.
Never reflect arbitrary inbound headers, cookies, authorization or credentials into responses or logs.
06 · Body and trailers
07 · Building outbound intent
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 fieldConnection 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