Index
port_http_server / com.hexagonkt.http.server / Call
Call¶
class Call
HTTP request context. It holds client supplied data and methods to change the response.
TODO Move Request, Response and Session abstract methods here and pass the call to them
Constructors¶
Name | Summary |
---|---|
<init> | HTTP request context. It holds client supplied data and methods to change the response.Call(request: Request , response: Response , session: Session ) |
Properties¶
Name | Summary |
---|---|
attributes | Call attributes (for the current request). Same as HttpServletRequest.setAttribute().val attributes: MutableMap < String , Any > |
formParameters | val formParameters: Map < String , String > |
formParametersValues | val formParametersValues: Map < String , List < String >> |
pathParameters | val pathParameters: Map < String , String > |
queryParameters | val queryParameters: Map < String , String > |
queryParametersValues | val queryParametersValues: Map < String , List < String >> |
request | val request: Request |
requestFormat | val requestFormat: SerializationFormat |
requestType | val requestType: String |
response | val response: Response |
responseFormat | val responseFormat: SerializationFormat |
responseType | val responseType: String |
session | val session: Session |
Functions¶
Name | Summary |
---|---|
halt | Sends error response.fun halt(content: Any ): Nothing fun halt(code: Int = 500, content: Any = ""): Nothing |
ok | Sends success response with given content type.fun ok(content: Any = "", contentType: String ? = null): Unit Sends success response serialized using given SerializationFormat and Charset. fun ok(content: Any , serializationFormat: SerializationFormat = responseFormat, charset: Charset ? = null): Unit |
redirect | Sends a redirect response to the client using the specified redirect URL.fun redirect(url: String ): Unit |
send | Sends response to the client.fun send(code: Int , content: Any = "", contentType: String ? = null): Unit Sends response to the client after serializing using given SerializationFormat and Charset. fun send(code: Int , content: Any , serializationFormat: SerializationFormat, charset: Charset ?): Unit Sends response to the client after serializing using given ContentType instance. fun send(code: Int , content: Any , contentType: ContentType): Unit |