send

fun send(code: Int, content: Any = "", contentType: String? = null)

Sends response to the client.

Parameters

code

Status code of the response.

content

Content of the response.

contentType

Content type of the response.


fun send(code: Int, content: Any, serializationFormat: SerializationFormat, charset: Charset?)

Sends response to the client after serializing using given SerializationFormat and Charset.

Parameters

code

Status code of the response.

content

Content of the response.

serializationFormat

Serialization format for serializing the response.

charset

Character Set to be used for the content type.


fun send(code: Int, content: Any, contentType: ContentType)

Sends response to the client after serializing using given ContentType instance.

Parameters

code

Status code of the response.

content

Content of the response.

contentType

Content type of the response.