Request
Information passed into an API endpoint from the client.
The request information will be passed in via an ApiContext. Developers implementing an API endpoint can read request values with code like the following:
@Api
suspend fun echo(ctx: ApiContext) {
val msg = ctx.req.params["msg"]
if (msg != null) {
ctx.res.body = Body.text("Received message: $msg")
}
else {
ctx.res.status = 400
ctx.res.body = Body.text("Missing: required parameter 'msg'")
}
}Content copied to clipboard
See also
Inheritors
Types
Properties
Link copied to clipboard
Information about the connection that carried the request.
Link copied to clipboard
The type of http method this call was sent with.
Link copied to clipboard
Like params but only for the query string.