KScript docs
EN

Routes and APIs

The request

$request, or a controller's request parameter, is a map with these keys:

Key What it holds
method The method, in upper case.
path, url The path, and the path with its query.
query, form, json, input The query, the form fields, the JSON body, and all three together.
files Uploaded files by input name, each a list of { name, type, size, bytes }. See Uploaded files.
body The raw text of the body.
headers The headers, with lower-case names.
cookies The cookies, by name.
params The path parameters.
ip The client's address.
route The matched route's name, or null.
has_valid_signature True when the URL carries a signature from @signed_url() that matches it and hasn't run out.

A value in query or form is text. A name sent more than once (?tag=a&tag=b) is a list of texts, so no value is lost. A typed field says which you want: tags: string[] takes the name sent once or many times and is always a list, while tag: string answers 422 when it is sent twice.