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
| Field | Type | Description |
|---|---|---|
.body | string | The raw request body. |
.cookies | map | Cookies sent by the client. |
.files | map | Uploaded files by input name, each a list of { name, type, size, bytes } where bytes is base64: $request.files.avatar[0]. |
.form | map | Posted form fields: $request.form.email. |
.headers | map | Request headers with lowercase names. |
.method | string | The HTTP method, such as GET or POST. |
.params | map | Parameters captured from the request path. |
.path | string | The path, such as /people. |
.query | map | Query string values: $request.query.page. |
.route_info | map | Metadata of the matched route or file-based page. |
.scheme | string | The request scheme, such as http or https. |
.url | string | The path with its query string, such as /people?page=2. |
Methods from any
->convert(from?: 'json'|yaml|'csv'|'markdown'|'latex', to?: 'json'|yaml|'csv'|html|'markdown'|'latex', header?: bool, as?: type, headers?: list, indented?: bool)->from(type: 'json'|yaml|'csv'|'markdown'|'latex', header?: bool, as?: type)->is_a(type: word)->is_null()->or(fallback)->to(type: 'json'|yaml|'csv'|html|'markdown'|'latex', headers?: list, indented?: bool)->to_string()->type()