Call

class Call(request: Request, response: Response, session: Session)

HTTP request context. It holds client supplied data and methods to change the response.

Constructors

Link copied to clipboard
fun Call(request: Request, response: Response, session: Session)

Functions

Link copied to clipboard
fun halt(content: Any): Nothing
fun halt(code: Int = 500, content: Any = ""): Nothing

Sends error response.

Link copied to clipboard
fun ok(content: Any = "", contentType: String? = null)

Sends success response with given content type.

fun ok(content: Any, serializationFormat: SerializationFormat = responseFormat, charset: Charset? = null)

Sends success response serialized using given SerializationFormat and Charset.

Link copied to clipboard
fun redirect(url: String)

Sends a redirect response to the client using the specified redirect URL.

Link copied to clipboard
fun send(code: Int, content: Any, contentType: ContentType)

Sends response to the client after serializing using given ContentType instance.

fun send(code: Int, content: Any = "", contentType: String? = null)

Sends response to the client.

fun send(code: Int, content: Any, serializationFormat: SerializationFormat, charset: Charset?)

Sends response to the client after serializing using given SerializationFormat and Charset.

Properties

Link copied to clipboard
val attributes: MutableMap<String, Any>

Call attributes (for the current request). Same as HttpServletRequest.setAttribute().

Link copied to clipboard
val formParameters: Map<String, String>
Link copied to clipboard
val formParametersValues: Map<String, List<String>>
Link copied to clipboard
val pathParameters: Map<String, String>
Link copied to clipboard
val queryParameters: Map<String, String>
Link copied to clipboard
val queryParametersValues: Map<String, List<String>>
Link copied to clipboard
val request: Request
Link copied to clipboard
val requestFormat: SerializationFormat
Link copied to clipboard
val requestType: String
Link copied to clipboard
val response: Response
Link copied to clipboard
val responseFormat: SerializationFormat
Link copied to clipboard
val responseType: String
Link copied to clipboard
val session: Session