class RoutingApplicationCall : ApplicationCall
Represents an application call being handled by Routing
RoutingApplicationCall(call: ApplicationCall, route: Route, receivePipeline: ApplicationReceivePipeline, responsePipeline: ApplicationSendPipeline, parameters: Parameters)
Represents an application call being handled by Routing |
val application: Application
Application being called |
|
val attributes: Attributes
Attributes attached to this instance |
|
val parameters: Parameters
Parameters associated with this call |
|
val request: RoutingApplicationRequest
Client request |
|
val response: RoutingApplicationResponse
Server response |
|
val route: Route
is the selected route |
fun toString(): String |
val ApplicationCall.callId: String?
A call id that is retrieved or generated by CallId feature or |
|
val ApplicationCall.sessionId: String?
Returns a sessionId for for a single session identified by ID. This will not work if there are multiple sessions by ID were registered or the Sessions feature is not installed. If you are using multiple sessions, please use sessionId function instead. |
|
val ApplicationCall.sessions: CurrentSession
Get current session or fail if no session feature installed |
fun ApplicationCall.defaultTextContentType(contentType: ContentType?): ContentType
Creates a default ContentType based on the given contentType and current call |
|
fun ApplicationCall.push(pathAndQuery: String): Unit fun ApplicationCall.push(encodedPath: String, parameters: Parameters): Unit
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. fun ApplicationCall.push(block: ResponsePushBuilder.() -> Unit): Unit
Produces HTTP/2 push from server to client or sets HTTP/1.x hint header or does nothing (may call or not call block). Exact behaviour is up to engine implementation. |
|
suspend fun <T : Any> ApplicationCall.receive(): T suspend fun <T : Any> ApplicationCall.receive(type: KClass<T>): T suspend fun <T : Any> ApplicationCall.receive(type: KType): T
Receives content for this request. |
|
suspend fun ApplicationCall.receiveChannel(): ByteReadChannel
Receives channel content for this call. |
|
suspend fun ApplicationCall.receiveMultipart(): MultiPartData
Receives multipart data for this call. |
|
suspend fun <T : Any> ApplicationCall.receiveOrNull(): T? suspend fun <T : Any> ApplicationCall.receiveOrNull(type: KType): T? suspend fun <T : Any> ApplicationCall.receiveOrNull(type: KClass<T>): T?
Receives content for this request. |
|
suspend fun ApplicationCall.receiveParameters(): Parameters
Receives form parameters for this call. |
|
suspend fun ApplicationCall.receiveStream(): InputStream
Receives stream content for this call. |
|
suspend fun ApplicationCall.receiveText(): String
Receives incoming content for this call as String. |
|
fun ApplicationCall.resolveResource(path: String, resourcePackage: String? = null, classLoader: ClassLoader = application.environment.classLoader, mimeResolve: (String) -> ContentType = { ContentType.defaultForFileExtension(it) }): OutgoingContent? |
|
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. |
|
fun <SessionType : Any> ApplicationCall.sessionId(): String?
Returns the corresponding session ID for the type SessionType or |
|
fun ApplicationCall.suitableCharset(defaultCharset: <ERROR CLASS> = Charsets.UTF_8): <ERROR CLASS>
Detect suitable charset for an application call by |
|
fun ApplicationCall.url(block: URLBuilder.() -> Unit = {}): String
Creates an url using current call's schema, path and parameters as initial and then invokes block function on the url builder so amend parameters |
|
suspend fun ApplicationCall.
Checks current etag value and pass it through conditions supplied by the remote client. Depends on conditions it produces 410 Precondition Failed or 304 Not modified responses when necessary. Otherwise sets ETag header and delegates to the block function |