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(context: Context<HttpCall>)
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>())
constructor(event: HttpCall, predicate: (Context<HttpCall>) -> Boolean, nextHandlers: Array<Handler<HttpCall>> = emptyArray(), nextHandler: Int = 0, exception: Exception? = null, attributes: Map<*, *> = emptyMap<Any, Any>(), handled: Boolean = false)

Properties

Link copied to clipboard
Link copied to clipboard
open override var attributes: Map<*, *>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var event: HttpCall
Link copied to clipboard
open override var exception: Exception?
Link copied to clipboard
Link copied to clipboard
open override var handled: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var nextHandler: Int
Link copied to clipboard
open override var nextHandlers: Array<Handler<HttpCall>>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val port: Int
Link copied to clipboard
open override var predicate: (Context<HttpCall>) -> Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val status: Int
Link copied to clipboard
val uri: URI
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 found(location: String, headers: Headers = response.headers, 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
open override fun next(): HttpContext
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 redirect(status: Int, location: String, headers: Headers = response.headers, cookies: List<Cookie> = response.cookies, attributes: Map<*, *> = this.attributes): HttpContext
Link copied to clipboard
fun send(request: HttpRequestPort, attributes: Map<*, *> = this.attributes): HttpContext
fun send(response: HttpResponsePort, attributes: Map<*, *> = this.attributes): HttpContext
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
Link copied to clipboard
open override fun with(event: HttpCall, predicate: (Context<HttpCall>) -> Boolean, nextHandlers: Array<Handler<HttpCall>>, nextHandler: Int, exception: Exception?, attributes: Map<*, *>, handled: Boolean): Context<HttpCall>