KScript docs
EN

request fields and methods

A field is a plain fact about the value, read with a dot and no brackets: $value.name. A method takes arguments or does work, and is called with ->: $value->name(arguments), or with the value piped in: $value |> name(arguments).

Fields

FieldTypeDescription
.bodystringThe raw request body.
.cookiesmapCookies sent by the client.
.filesmapUploaded files by input name, each a list of { name, type, size, bytes } where bytes is base64: $request.files.avatar[0].
.formmapPosted form fields: $request.form.email.
.headersmapRequest headers with lowercase names.
.methodstringThe HTTP method, such as GET or POST.
.paramsmapParameters captured from the request path.
.pathstringThe path, such as /people.
.querymapQuery string values: $request.query.page.
.route_infomapMetadata of the matched route or file-based page.
.schemestringThe request scheme, such as http or https.
.urlstringThe path with its query string, such as /people?page=2.

Methods from any