ApplicationResponse

interface ApplicationResponse

Represents server's response

Functions

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

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

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

Currently set status code for this response, or null if none was set

abstract fun status(value: HttpStatusCode)

Set status for this response

Properties

Link copied to clipboard
abstract val call: ApplicationCall

ApplicationCall instance this ApplicationResponse is attached to

Link copied to clipboard
abstract val cookies: ResponseCookies

Cookies for this response

Link copied to clipboard
abstract val headers: ResponseHeaders

Headers for this response

Link copied to clipboard
abstract val pipeline: ApplicationSendPipeline

Pipeline for sending content

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
fun ApplicationResponse.cacheControl(value: CacheControl)

Append response Cache-Control HTTP header value

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)

Append response Content-Range header with specified range and fullLength

Link copied to clipboard
fun ApplicationResponse.etag(value: String)

Append response E-Tag HTTP header value

Link copied to clipboard
fun ApplicationResponse.expires(value: LocalDateTime)

Append response Expires HTTP header value

Link copied to clipboard
fun ApplicationResponse.header(name: String, value: String)

Append HTTP response header with string value

fun ApplicationResponse.header(name: String, value: Int)

Append HTTP response header with integer numeric value

fun ApplicationResponse.header(name: String, value: Long)

Append HTTP response header with long integer numeric value

fun ApplicationResponse.header(name: String, date: Temporal)

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

Link copied to clipboard
fun ApplicationResponse.lastModified(dateTime: ZonedDateTime)

Append response Last-Modified HTTP header value from dateTime

Link copied to clipboard
fun ApplicationResponse.link(header: LinkHeader)

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
var ApplicationResponse.responseType: KType?

Type of the response object that was passed in respond function. Can be useful for custom serializations.