HttpServerContext

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

Constructors

Link copied to clipboard
constructor(context: Context<HttpServerCall>)
constructor(request: HttpServerRequestPort = HttpServerRequest(), response: HttpServerResponse = HttpServerResponse(), predicate: HttpServerPredicate = HttpServerPredicate(), attributes: Map<*, *> = emptyMap<Any, Any>())
constructor(event: HttpServerCall, predicate: (Context<HttpServerCall>) -> Boolean, nextHandlers: List<Handler<HttpServerCall>> = emptyList(), nextHandler: Int = 0, exception: Exception? = null, attributes: Map<*, *> = emptyMap<Any, Any>())

Functions

Link copied to clipboard
fun accepted(onConnect: WsServerSession.() -> Unit = {}, onBinary: WsServerSession.(data: ByteArray) -> Unit = {}, onText: WsServerSession.(text: String) -> Unit = {}, onPing: WsServerSession.(data: ByteArray) -> Unit = {}, onPong: WsServerSession.(data: ByteArray) -> Unit = {}, onClose: WsServerSession.(status: WsCloseStatus, reason: String) -> Unit = { _, _ -> }): HttpServerContext
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): HttpServerContext
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): HttpServerContext
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): HttpServerContext
Link copied to clipboard
fun internalServerError(exception: Exception, headers: Headers = response.headers, attributes: Map<*, *> = this.attributes): HttpServerContext
fun internalServerError(body: Any = response.body, headers: Headers = response.headers, contentType: ContentType? = response.contentType, cookies: List<Cookie> = response.cookies, attributes: Map<*, *> = this.attributes): HttpServerContext
Link copied to clipboard
open override fun next(): HttpServerContext
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): HttpServerContext
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): HttpServerContext
Link copied to clipboard
fun send(response: HttpServerResponse, attributes: Map<*, *> = this.attributes): HttpServerContext
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): HttpServerContext
Link copied to clipboard
fun serverError(status: HttpStatus, exception: Exception, headers: Headers = response.headers, attributes: Map<*, *> = this.attributes): HttpServerContext
Link copied to clipboard
fun sse(body: Flow.Publisher<ServerEvent>): HttpServerContext
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): HttpServerContext
Link copied to clipboard
open override fun with(event: HttpServerCall, predicate: (Context<HttpServerCall>) -> Boolean, nextHandlers: List<Handler<HttpServerCall>>, nextHandler: Int, exception: Exception?, attributes: Map<*, *>): Context<HttpServerCall>

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: HttpServerCall
Link copied to clipboard
open override val exception: Exception? = null
Link copied to clipboard
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<HttpServerCall>>
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<HttpServerCall>) -> 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?