HttpContext
class HttpContext(var event: HttpCall, var predicate: (Context<HttpCall>) -> Boolean, var nextHandlers: Array<Handler<HttpCall>> = emptyArray(), var nextHandler: Int = 0, var exception: Exception? = null, var attributes: Map<*, *> = emptyMap<Any, Any>(), var handled: Boolean = false) : Context<HttpCall>
Constructors
Link copied to clipboard
constructor(event: HttpCall, predicate: (Context<HttpCall>) -> Boolean, nextHandlers: List<Handler<HttpCall>>, nextHandler: Int = 0, exception: Exception? = null, attributes: Map<*, *> = emptyMap<Any, Any>(), handled: Boolean = false)
constructor(request: HttpRequestPort = HttpRequest(), response: HttpResponsePort = HttpResponse(), predicate: HttpPredicate = HttpPredicate(), attributes: Map<*, *> = emptyMap<Any, Any>())
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Functions
Link copied to clipboard
fun accepted(onConnect: WsSession.() -> Unit = {}, onBinary: WsSession.(data: ByteArray) -> Unit = {}, onText: WsSession.(text: String) -> Unit = {}, onPing: WsSession.(data: ByteArray) -> Unit = {}, onPong: WsSession.(data: ByteArray) -> Unit = {}, onClose: WsSession.(status: Int, reason: String) -> Unit = { _, _ -> }): HttpContext
Link copied to clipboard
fun badRequest(body: Any = response.body, headers: Headers = response.headers, contentType: ContentType? = response.contentType, cookies: List<Cookie> = response.cookies, attributes: Map<*, *> = this.attributes): HttpContext
Link copied to clipboard
fun created(body: Any = response.body, headers: Headers = response.headers, contentType: ContentType? = response.contentType, cookies: List<Cookie> = response.cookies, attributes: Map<*, *> = this.attributes): HttpContext
Link copied to clipboard
fun forbidden(body: Any = response.body, headers: Headers = response.headers, contentType: ContentType? = response.contentType, cookies: List<Cookie> = response.cookies, attributes: Map<*, *> = this.attributes): HttpContext
Link copied to clipboard
fun internalServerError(exception: Exception, headers: Headers = response.headers, attributes: Map<*, *> = this.attributes): HttpContext
fun internalServerError(body: Any = response.body, headers: Headers = response.headers, contentType: ContentType? = response.contentType, cookies: List<Cookie> = response.cookies, attributes: Map<*, *> = this.attributes): HttpContext
Link copied to clipboard
Link copied to clipboard
fun notFound(body: Any = response.body, headers: Headers = response.headers, contentType: ContentType? = response.contentType, cookies: List<Cookie> = response.cookies, attributes: Map<*, *> = this.attributes): HttpContext
Link copied to clipboard
fun ok(body: Any = response.body, headers: Headers = response.headers, contentType: ContentType? = response.contentType, cookies: List<Cookie> = response.cookies, attributes: Map<*, *> = this.attributes): HttpContext
Link copied to clipboard
fun receive(body: Any = request.body, headers: Headers = request.headers, contentType: ContentType? = request.contentType, accept: List<ContentType> = request.accept, cookies: List<Cookie> = request.cookies, attributes: Map<*, *> = this.attributes): HttpContext
Link copied to clipboard
fun send(status: Int = response.status, body: Any = response.body, headers: Headers = response.headers, contentType: ContentType? = response.contentType, cookies: List<Cookie> = response.cookies, attributes: Map<*, *> = this.attributes): HttpContext
Link copied to clipboard
fun serverError(status: Int, exception: Exception, headers: Headers = response.headers, attributes: Map<*, *> = this.attributes): HttpContext
Link copied to clipboard
Link copied to clipboard
fun unauthorized(body: Any = response.body, headers: Headers = response.headers, contentType: ContentType? = response.contentType, cookies: List<Cookie> = response.cookies, attributes: Map<*, *> = this.attributes): HttpContext