Response

class Response(adapter: ResponsePort)

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.

HTTP response context.

Constructors

Link copied to clipboard
fun Response(adapter: ResponsePort)

Types

Link copied to clipboard
interface MapInterface<K, V>

Functions

Link copied to clipboard
fun addCookie(cookie: Cookie)

Sends a response by adding the given cookie.

Link copied to clipboard
fun redirect(url: String)

Sends a redirect response to the client using the specified redirect URL.

Link copied to clipboard
fun removeCookie(name: String)

Sends a response by removing the cookie with specified name.

Properties

Link copied to clipboard
val adapter: ResponsePort
Link copied to clipboard
var body: Any

Body of the response.

Link copied to clipboard
var contentType: String?

Content Type of the response.

Link copied to clipboard
val headers: Response.MapInterface<String, Any>

A MapInterface implementation for response headers.

Link copied to clipboard
val headersValues: MutableMap<String, List<Any>>

Response headers.

Link copied to clipboard
val outputStream: OutputStream

Output Stream of the response.

Link copied to clipboard
var status: Int

Status code of the response.