ApplicationResponse

A server's response. To learn how to send responses inside route handlers, see Sending responses.

See also

Inheritors

Properties

Link copied to clipboard
abstract val call: ApplicationCall

An ApplicationCall instance this ApplicationResponse is attached to.

Link copied to clipboard
abstract val cookies: ResponseCookies

Provides access to cookies for this response.

Link copied to clipboard
abstract val headers: ResponseHeaders

Provides access to headers for the current response.

Link copied to clipboard
abstract val isCommitted: Boolean

Indicates that this response is already committed and no further changes are allowed.

Link copied to clipboard
abstract val isSent: Boolean

Indicates that this response is already fully sent to the client.

Link copied to clipboard

A type of response object that is passed in the respond function. Can be useful for custom serializations.

Functions

Link copied to clipboard

Appends the Cache-Control header with the specified value to a response.

Link copied to clipboard
fun ApplicationResponse.contentRange(range: LongRange?, fullLength: Long? = null, unit: RangeUnits)
fun ApplicationResponse.contentRange(range: LongRange?, fullLength: Long? = null, unit: String = RangeUnits.Bytes.unitToken)

Appends the Content-Range header with the specified range and fullLength to a response.

Link copied to clipboard

Appends the E-Tag header with the specified value to a response.

Link copied to clipboard

Append response Expires HTTP header value

Link copied to clipboard

Appends a header with the specified name and value to a response.

Append HTTP response header with temporal date (date, time and so on)

Link copied to clipboard

Append response Last-Modified HTTP header value from dateTime

Link copied to clipboard

Append Link header to HTTP response

fun ApplicationResponse.link(uri: String, vararg rel: String)

Append Link header to HTTP response with specified uri and rel

Link copied to clipboard
abstract fun push(builder: ResponsePushBuilder)

Produces HTTP/2 push from a server to a client or sets an HTTP/1.x hint header or does nothing. Exact behaviour is up to engine implementation.

Link copied to clipboard
abstract fun status(): HttpStatusCode?

Returns a response status code or null if a status code is not set.

abstract fun status(value: HttpStatusCode)

Specifies a status code for a response.