interface ApplicationResponse
Represents server's response |
|
open class ApplicationSendPipeline : Pipeline<Any, ApplicationCall>
Server response send pipeline |
|
class DefaultResponsePushBuilder : ResponsePushBuilder
HTTP/2 push builder |
|
class ResponseCookies
Server's response cookies |
|
abstract class ResponseHeaders
Server's response headers |
|
interface ResponsePushBuilder
HTTP/2 push builder interface |
annotation class UseHttp2Push
HTTP/2 push is no longer supported by Chrome web browser. Other browsers may discard it at some point. With such browsers, HTTP/2 push will be disabled, therefore using this feature is safe but it will have no effect. On the other hand, this feature is not deprecated and generally it is still allowed to use it, so feel free to opt-in this annotation to eliminate this warning, if you are sure that you need it. For example, it makes sense to use with a non-browser client that for sure supports HTTP/2 push. |
var ApplicationResponse.responseType: KType?
Type of the response object that was passed in respond function. Can be useful for custom serializations. |
fun ApplicationResponse.cacheControl(value: CacheControl): Unit
Append response fun HeadersBuilder.cacheControl(value: CacheControl): Unit
Append |
|
fun HeadersBuilder.contentRange(range: LongRange?, fullLength: Long? = null, unit: String = RangeUnits.Bytes.unitToken): Unit
Append 'Content-Range` header with specified range and fullLength fun ApplicationResponse.contentRange(range: LongRange?, fullLength: Long? = null, unit: RangeUnits): Unit fun ApplicationResponse.contentRange(range: LongRange?, fullLength: Long? = null, unit: String = RangeUnits.Bytes.unitToken): Unit
Append response |
|
fun ApplicationCall.defaultTextContentType(contentType: ContentType?): ContentType
Creates a default ContentType based on the given contentType and current call |
|
fun ApplicationResponse.etag(value: String): Unit
Append response |
|
fun ApplicationResponse.expires(value: LocalDateTime): Unit
Append response |
|
fun ApplicationResponse.header(name: String, value: String): Unit
Append HTTP response header with string value fun ApplicationResponse.header(name: String, value: Int): Unit
Append HTTP response header with integer numeric value fun ApplicationResponse.header(name: String, value: Long): Unit
Append HTTP response header with long integer numeric value fun ApplicationResponse.header(name: String, date: Temporal): Unit
Append HTTP response header with temporal date (date, time and so on) |
|
fun ApplicationResponse.lastModified(dateTime: ZonedDateTime): Unit
Append response |
|
suspend fun <T : Any> ApplicationCall.respond(message: T): Unit suspend fun ApplicationCall.
Sends a message as a response suspend fun <T : Any> ApplicationCall.respond(status: HttpStatusCode, message: T): Unit suspend fun ApplicationCall.
|
|
suspend fun ApplicationCall.respondBytes(contentType: ContentType? = null, status: HttpStatusCode? = null, provider: suspend () -> ByteArray): Unit
Responds to a client with a raw bytes response, using specified provider to build a byte array suspend fun ApplicationCall.respondBytes(bytes: ByteArray, contentType: ContentType? = null, status: HttpStatusCode? = null, configure: OutgoingContent.() -> Unit = {}): Unit
Responds to a client with a raw bytes response, using specified bytes |
|
suspend fun ApplicationCall.respondBytesWriter(contentType: ContentType? = null, status: HttpStatusCode? = null, producer: suspend ByteWriteChannel.() -> Unit): Unit
Respond with binary content producer. |
|
suspend fun ApplicationCall.respondFile(baseDir: File, fileName: String, configure: OutgoingContent.() -> Unit = {}): Unit
Responds to a client with a contents of a file with the name fileName in the baseDir folder suspend fun ApplicationCall.respondFile(file: File, configure: OutgoingContent.() -> Unit = {}): Unit
Responds to a client with a contents of a file |
|
suspend fun ApplicationCall.respondOutputStream(contentType: ContentType? = null, status: HttpStatusCode? = null, producer: suspend OutputStream.() -> Unit): Unit
Respond with binary content producer. |
|
suspend fun ApplicationCall.respondRedirect(url: String, permanent: Boolean = false): Unit
Responds to a client with a suspend fun ApplicationCall.respondRedirect(permanent: Boolean = false, block: URLBuilder.() -> Unit): Unit
Responds to a client with a |
|
suspend fun ApplicationCall.respondText(text: String, contentType: ContentType? = null, status: HttpStatusCode? = null, configure: OutgoingContent.() -> Unit = {}): Unit
Responds to a client with a plain text response, using specified text suspend fun ApplicationCall.respondText(contentType: ContentType? = null, status: HttpStatusCode? = null, provider: suspend () -> String): Unit
Responds to a client with a plain text response, using specified provider to build a text |
|
suspend fun ApplicationCall.respondTextWriter(contentType: ContentType? = null, status: HttpStatusCode? = null, writer: suspend Writer.() -> Unit): Unit
Respond with text content writer. |