Package-level declarations

Classes to model server HTTP messages (requests and responses). Built on top of the http module.

Types

Link copied to clipboard
data class HttpServerCall(val request: HttpServerRequestPort = HttpServerRequest(), val response: HttpServerResponse = HttpServerResponse()) : HttpCall<HttpServerRequestPort, HttpServerResponse>
Link copied to clipboard
data class HttpServerRequest(val method: HttpMethod = GET, val protocol: HttpProtocol = HTTP, val host: String = "localhost", val port: Int = 80, val path: String = "", val queryParameters: QueryParameters = QueryParameters(), val headers: Headers = Headers(), val body: Any = "", val parts: List<HttpPart> = emptyList(), val formParameters: FormParameters = FormParameters(), val cookies: List<Cookie> = emptyList(), val contentType: ContentType? = null, val certificateChain: List<X509Certificate> = emptyList(), val accept: List<ContentType> = emptyList(), val contentLength: Long = -1L, val authorization: Authorization? = null) : HttpServerRequestPort
Link copied to clipboard
Link copied to clipboard
data class HttpServerResponse(val body: Any = "", val headers: Headers = Headers(), val contentType: ContentType? = null, val cookies: List<Cookie> = emptyList(), val status: HttpStatus = NOT_FOUND, val onConnect: WsServerSession.() -> Unit = {}, val onBinary: WsServerSession.(data: ByteArray) -> Unit = {}, val onText: WsServerSession.(text: String) -> Unit = {}, val onPing: WsServerSession.(data: ByteArray) -> Unit = {}, val onPong: WsServerSession.(data: ByteArray) -> Unit = {}, val onClose: WsServerSession.(status: WsCloseStatus, reason: String) -> Unit = { _, _ -> }) : HttpResponse