HttpContext

data class HttpContext(val event: HttpCall, val predicate: (Context<HttpCall>) -> Boolean, val nextHandlers: List<Handler<HttpCall>> = emptyList(), val nextHandler: Int = 0, val exception: Exception? = null, val attributes: Map<*, *> = emptyMap<Any, Any>(), val handled: Boolean = false) : Context<HttpCall>

Constructors

Link copied to clipboard
constructor(context: Context<HttpCall>)
constructor(request: HttpRequestPort = HttpRequest(), response: HttpResponsePort = HttpResponse(), predicate: HttpPredicate = HttpPredicate(), attributes: Map<*, *> = emptyMap<Any, Any>())
constructor(event: HttpCall, predicate: (Context<HttpCall>) -> Boolean, nextHandlers: List<Handler<HttpCall>> = emptyList(), nextHandler: Int = 0, exception: Exception? = null, attributes: Map<*, *> = emptyMap<Any, Any>(), handled: Boolean = false)

Properties

Link copied to clipboard
val accept: List<ContentType>
Link copied to clipboard
open override val attributes: Map<*, *>
Link copied to clipboard
Link copied to clipboard
val certificate: X509Certificate?
Link copied to clipboard
val certificateChain: List<X509Certificate>
Link copied to clipboard
open override val event: HttpCall
Link copied to clipboard
open override val exception: Exception? = null
Link copied to clipboard
Link copied to clipboard
open override val handled: Boolean = false
Link copied to clipboard
val host: String
Link copied to clipboard
Link copied to clipboard
open override val nextHandler: Int = 0
Link copied to clipboard
open override val nextHandlers: List<Handler<HttpCall>>
Link copied to clipboard
val origin: String?
Link copied to clipboard
val parts: List<HttpPart>
Link copied to clipboard
val partsMap: Map<String, HttpPart>
Link copied to clipboard
val path: String
Link copied to clipboard
val pathParameters: Map<String, String>
Link copied to clipboard
val port: Int
Link copied to clipboard
open override val predicate: (Context<HttpCall>) -> Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val referer: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val url: URL
Link copied to clipboard
val userAgent: String?

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: HttpStatus, 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: HttpStatus = 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: HttpStatus, exception: Exception, headers: Headers = response.headers, attributes: Map<*, *> = this.attributes): HttpContext
Link copied to clipboard
fun sse(body: Flow.Publisher<ServerEvent>): HttpContext
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: List<Handler<HttpCall>>, nextHandler: Int, exception: Exception?, attributes: Map<*, *>, handled: Boolean): Context<HttpCall>