Response
Data to send back to the client after it makes a request to an API endpoint.
An empty successful response is automatically created and passed into an API via an ApiContext. Developers implementing an API endpoint should modify this response with code like the following:
@Api
fun demo(ctx: ApiContext) {
ctx.res.setBodyText("This is how you send text back to the client")
}
Content copied to clipboard
See also
Properties
Link copied to clipboard
The content type of the body, e.g. "image/jpeg" or "application/json". Can include parameters.
Link copied to clipboard
Any additional headers to send back to the client.