Skip to content

Home

com.hexagonkt.http.server / Request

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).

HTTP request context. It holds client supplied data and methods to change the response.

Constructors

Name Summary
<init> 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).

Properties

Name Summary
accept val accept:List<String>
body val body:String
contentLength val contentLength:Long
contentType val contentType:String?
cookies val cookies:Map<String,HttpCookie>
formParameters val formParameters:Map<String,List<String>>
headers val headers:Map<String,List<String>>
host val host:String
ip val ip:String
method val method: Method
origin val origin:String?
parameters val parameters:Map<String,List<String>>
parts val parts:Map<String,Part>
path val path:String
pathParameters val pathParameters: RequiredKeysMap<String,String>
port val port:Int
preferredType val preferredType:String?
queryParameters val queryParameters:Map<String,List<String>>
queryString val queryString:String
referer val referer:String?
scheme val scheme:String
secure val secure:Boolean
url val url:String
userAgent val userAgent:String?

Functions

Name Summary
body fun <T :Any> body(type:KClass<T>):T
fun <T :Any> body():T
bodyObjects fun <T :Any> bodyObjects(type:KClass<T>):List<T>
fun <T :Any> bodyObjects():List<T>
contentLength abstract fun contentLength():Long
contentType abstract fun contentType():String?
cookies abstract fun cookies():Map<String,HttpCookie>
formParameters abstract fun formParameters():Map<String,List<String>>
headers abstract fun headers():Map<String,List<String>>
host abstract fun host():String
ip abstract fun ip():String
loadBody abstract fun loadBody():String
method abstract fun method(): Method
parameters abstract fun parameters():Map<String,List<String>>
parts abstract fun parts():Map<String,Part>
path abstract fun path():String
pathParameters abstract fun pathParameters():Map<String,String>
port abstract fun port():Int
queryParameters abstract fun queryParameters():Map<String,List<String>>
queryString abstract fun queryString():String
scheme abstract fun scheme():String
url abstract fun url():String