Home

com.hexagonkt.http.server

Package com.hexagonkt.http.server

This package defines the classes used in the HTTP DSL.

Types

Name Summary
Call class Call
HTTP request context. It holds client supplied data and methods to change the response.
FilterOrder enum class FilterOrder
Type of filter. Indicates when the filter is executed.
Part data class Part
PortHttpServerSamplesTest abstract class PortHttpServerSamplesTest
Request abstract class Request
Lists would be initialized loading all elements when they are used (set it as lazy in implementations) this will have a performance penalty in favor of ease of use. The alternative would be using a 'Map/List wrapper that delegates calls to abstract methods in the interface (I won't do this just now).
RequestHandler sealed class RequestHandler
Response abstract class Response
Check 'Request' comment. And also note that lists should be updated by engines after callback is processed, this data is like a buffer that needs to be dumped to the real response.
Router class Router
TODO Document. TODO Index routes (ie: GET /foo) TODO Map with routes to all handlers needed Creates and initializes a Router based on a code block.
Server data class Server
A server that listen to HTTP connections on a port and address and route requests using a router.
ServerPort interface ServerPort
Represents a server instance of one kind.
ServerSettings data class ServerSettings
Session abstract class Session
Provides session information.

Type Aliases

Name Summary
ErrorCodeCallback typealias ErrorCodeCallback =Call.(Int) ->Unit
Alias for errors' callbacks. Functions executed to handle a HTTP error code.
ExceptionCallback typealias ExceptionCallback =Call.(Exception) ->Unit
Alias for exceptions' callbacks. Functions executed when an exception is thrown.
RouteCallback typealias RouteCallback =Call.() ->Unit
Alias for routes' and filters' callbacks. Functions executed when a route is matched.