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
fun echo(ctx: ApiContext) {
val msg = ctx.req.params["msg"]
if (msg != null) {
ctx.res.setBodyText("Received message: $msg")
}
else {
ctx.res.status = 400
ctx.res.setBodyText("Missing: required parameter 'msg'")
}
}
Content copied to clipboard
See also
Inheritors
Types
Properties
Link copied to clipboard
An (optional) payload sent with the request. Will only potentially be set with appropriate methods that are allowed to send data, i.e. HttpMethod.POST, HttpMethod.PUT, and HttpMethod.PATCH
Link copied to clipboard
Information about the connection that carried the request.
Link copied to clipboard
The content type of the body, if set and sent.
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, just in case a user needs to disambiguate between a dynamic path part and a query parameter with the same name.