Package-level declarations

Types

Link copied to clipboard
data class AfterHandler(val handlerPredicate: HttpPredicate = HttpPredicate(), val block: HttpCallbackType) : HttpHandler, Handler<HttpCall>
Link copied to clipboard
data class BeforeHandler(val handlerPredicate: HttpPredicate = HttpPredicate(), val block: HttpCallbackType) : HttpHandler, Handler<HttpCall>
Link copied to clipboard
data class ExceptionHandler<E : Exception>(val exception: KClass<E>, val clear: Boolean = true, val block: HttpExceptionCallbackType<E>) : HttpHandler, Handler<HttpCall>
Link copied to clipboard
data class FilterHandler(val handlerPredicate: HttpPredicate = HttpPredicate(), val block: HttpCallbackType) : HttpHandler, Handler<HttpCall>
Link copied to clipboard
class HandlerBuilder(var handlers: List<HttpHandler> = emptyList())
Link copied to clipboard
interface HttpCallback : Function1<HttpContext, HttpContext>
Link copied to clipboard
Link copied to clipboard
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>
Link copied to clipboard

Utility to encapsulate a handler in a class. TODO

Link copied to clipboard
interface HttpExceptionCallback<T> : Function2<HttpContext, T, HttpContext>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class HttpPredicate(val methods: Set<HttpMethod> = emptySet(), val pathPattern: PathPattern = LiteralPathPattern(), val exception: KClass<out Exception>? = null, val status: HttpStatus? = null) : Function1<Context<HttpCall>, Boolean>
Link copied to clipboard
data class OnHandler(val handlerPredicate: HttpPredicate = HttpPredicate(), val block: HttpCallbackType) : HttpHandler, Handler<HttpCall>
Link copied to clipboard
data class PathHandler(val handlerPredicate: HttpPredicate, val handlers: List<HttpHandler>) : HttpHandler, Handler<HttpCall>

Functions

Link copied to clipboard
fun bodyToBytes(body: Any): ByteArray
Link copied to clipboard
fun Delete(pattern: String = "", callback: HttpCallbackType): OnHandler
Link copied to clipboard
fun Get(pattern: String = "", callback: HttpCallbackType): OnHandler
Link copied to clipboard
fun Head(pattern: String = "", callback: HttpCallbackType): OnHandler
Link copied to clipboard
fun Options(pattern: String = "", callback: HttpCallbackType): OnHandler
Link copied to clipboard
fun Patch(pattern: String = "", callback: HttpCallbackType): OnHandler
Link copied to clipboard
fun path(pattern: String = "", block: HandlerBuilder.() -> Unit): PathHandler
fun path(contextPath: String = "", handlers: List<HttpHandler>): PathHandler
Link copied to clipboard
fun Post(pattern: String = "", callback: HttpCallbackType): OnHandler
Link copied to clipboard
fun HttpCallbackType.process(request: HttpRequest, attributes: Map<*, *> = emptyMap<Any, Any>()): HttpContext
fun HttpCallbackType.process(method: HttpMethod = GET, protocol: HttpProtocol = HTTP, host: String = "localhost", port: Int = 80, path: String = "", queryParameters: QueryParameters = QueryParameters(), headers: Headers = Headers(), body: Any = "", parts: List<HttpPart> = emptyList(), formParameters: FormParameters = FormParameters(), cookies: List<Cookie> = emptyList(), contentType: ContentType? = null, certificateChain: List<X509Certificate> = emptyList(), accept: List<ContentType> = emptyList(), contentLength: Long = -1L, attributes: Map<*, *> = emptyMap<Any, Any>()): HttpContext
Link copied to clipboard
fun Put(pattern: String = "", callback: HttpCallbackType): OnHandler
Link copied to clipboard
fun Trace(pattern: String = "", callback: HttpCallbackType): OnHandler
Link copied to clipboard
fun Ws(pattern: String = "", callback: HttpCallbackType): OnHandler