RoutingPipelineCall

class RoutingPipelineCall(val engineCall: PipelineCall, val route: RoutingNode, val coroutineContext: CoroutineContext, receivePipeline: ApplicationReceivePipeline, responsePipeline: ApplicationSendPipeline, val pathParameters: Parameters) : PipelineCall, CoroutineScope

An application call handled by RoutingRoot.

Constructors

Link copied to clipboard
constructor(engineCall: PipelineCall, route: RoutingNode, coroutineContext: CoroutineContext, receivePipeline: ApplicationReceivePipeline, responsePipeline: ApplicationSendPipeline, pathParameters: Parameters)

Properties

Link copied to clipboard
open override val application: Application

An application being called.

Link copied to clipboard
open override val attributes: Attributes

Attributes attached to this call.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Checks if response body compression is suppressed for this ApplicationCall.

Link copied to clipboard

Indicates if a response is sent.

Link copied to clipboard
open override val parameters: Parameters

Parameters associated with this call.

Link copied to clipboard
Link copied to clipboard

The TypeInfo recorded from the last call.receive() call.

Link copied to clipboard
open override val request: RoutingPipelineRequest

An PipelineRequest that is a client request.

Link copied to clipboard

An PipelineResponse that is a server response.

Link copied to clipboard

is the selected route

Functions

Link copied to clipboard

Creates a default ContentType based on the given contentType and current call.

Link copied to clipboard
fun <TEngine : ApplicationEngine, TConfiguration : ApplicationEngine.Configuration> CoroutineScope.embeddedServer(factory: ApplicationEngineFactory<TEngine, TConfiguration>, vararg connectors: EngineConnectorConfig = arrayOf(), watchPaths: List<String> = listOf(WORKING_DIRECTORY_PATH), parentCoroutineContext: CoroutineContext = EmptyCoroutineContext, module: Application.() -> Unit): EmbeddedServer<TEngine, TConfiguration>

Creates an embedded server with the given factory, listening on given connectors.

fun <TEngine : ApplicationEngine, TConfiguration : ApplicationEngine.Configuration> CoroutineScope.embeddedServer(factory: ApplicationEngineFactory<TEngine, TConfiguration>, port: Int = 80, host: String = "0.0.0.0", watchPaths: List<String> = listOf(WORKING_DIRECTORY_PATH), parentCoroutineContext: CoroutineContext = EmptyCoroutineContext, module: Application.() -> Unit): EmbeddedServer<TEngine, TConfiguration>

Creates an embedded server with the given factory, listening on host:port.

Link copied to clipboard

Checks if the application call is requesting static content

Link copied to clipboard

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.

fun ApplicationCall.push(pathAndQuery: String)
fun ApplicationCall.push(encodedPath: String, encodedParameters: Parameters)

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
inline suspend fun <T : Any> ApplicationCall.receive(): T
suspend fun <T> ApplicationCall.receive(typeInfo: TypeInfo): T
suspend fun <T : Any> ApplicationCall.receive(type: KClass<T>): T

Receives content for this request.

Link copied to clipboard

Receives channel content for this call.

Link copied to clipboard

Receives multipart data for this call.

Link copied to clipboard
open suspend override fun <T> receiveNullable(typeInfo: TypeInfo): T?

Receives content for this request.

Link copied to clipboard
inline suspend fun <T> ApplicationCall.receiveNullable(): T?

Receives content for this request.

Link copied to clipboard
inline suspend fun <T : Any> ApplicationCall.receiveOrNull(): T?
suspend fun <T : Any> ApplicationCall.receiveOrNull(typeInfo: TypeInfo): T?
suspend fun <T : Any> ApplicationCall.receiveOrNull(type: KClass<T>): T?

Receives content for this request.

Link copied to clipboard

Receives form parameters for this call.

Link copied to clipboard

Receives stream content for this call.

Link copied to clipboard
inline suspend fun ApplicationCall.receiveText(): String

Receives incoming content for this call as String.

Link copied to clipboard
fun ApplicationCall.resolveResource(path: String, resourcePackage: String? = null, classLoader: ClassLoader = application.environment.classLoader, mimeResolve: (String) -> ContentType = { ContentType.defaultForFileExtension(it) }): OutgoingContent.ReadChannelContent?
Link copied to clipboard
open suspend override fun respond(message: Any?, typeInfo: TypeInfo?)

Sends a message as a response.

Link copied to clipboard
inline suspend fun <T : Any> ApplicationCall.respond(message: T)

Sends a message as a response.

@JvmName(name = "respondWithType")
inline suspend fun <T : Any> ApplicationCall.respond(status: HttpStatusCode, message: T)

Sends a message as a response with the specified status code.

suspend fun ApplicationCall.respond(status: HttpStatusCode, message: Any?, messageType: TypeInfo)

Sends a message of type messageType as a response with the specified status code.

Link copied to clipboard
suspend fun ApplicationCall.respondBytes(contentType: ContentType? = null, status: HttpStatusCode? = null, provider: suspend () -> ByteArray)

Responds to a client with a raw bytes response, using the specified provider to build a byte array.

suspend fun ApplicationCall.respondBytes(bytes: ByteArray, contentType: ContentType? = null, status: HttpStatusCode? = null, configure: OutgoingContent.() -> Unit = {})

Responds to a client with a raw bytes response, using specified bytes.

Link copied to clipboard
suspend fun ApplicationCall.respondBytesWriter(contentType: ContentType? = null, status: HttpStatusCode? = null, contentLength: Long? = null, producer: suspend ByteWriteChannel.() -> Unit)

Respond with a binary content producer.

Link copied to clipboard
suspend fun ApplicationCall.respondFile(file: File, configure: OutgoingContent.() -> Unit = {})

Responds to a client with a contents of a file

suspend fun ApplicationCall.respondFile(baseDir: File, fileName: String, configure: OutgoingContent.() -> Unit = {})

Responds to a client with a contents of a file with the name fileName in the baseDir folder

Link copied to clipboard
inline suspend fun <T> ApplicationCall.respondNullable(message: T)

Sends a message as a response.

inline suspend fun <T> ApplicationCall.respondNullable(status: HttpStatusCode, message: T)

Sends a message as a response with the specified status code.

Link copied to clipboard
suspend fun ApplicationCall.respondOutputStream(contentType: ContentType? = null, status: HttpStatusCode? = null, producer: suspend OutputStream.() -> Unit)
suspend fun ApplicationCall.respondOutputStream(contentType: ContentType? = null, status: HttpStatusCode? = null, contentLength: Long? = null, producer: suspend OutputStream.() -> Unit)

Respond with binary content producer.

Link copied to clipboard
suspend fun ApplicationCall.respondRedirect(url: Url, permanent: Boolean = false)
suspend fun ApplicationCall.respondRedirect(url: String, permanent: Boolean = false)

Responds to a client with a 301 Moved Permanently or 302 Found redirect.

inline suspend fun ApplicationCall.respondRedirect(permanent: Boolean = false, block: URLBuilder.() -> Unit)

Responds to a client with a 301 Moved Permanently or 302 Found redirect. Unlike the other respondRedirect, it provides a way to build a URL based on current call using the block function.

Link copied to clipboard
suspend fun ApplicationCall.respondText(contentType: ContentType? = null, status: HttpStatusCode? = null, provider: suspend () -> String)

Responds to a client with a plain text response, using the specified provider to build a text.

suspend fun ApplicationCall.respondText(text: String, contentType: ContentType? = null, status: HttpStatusCode? = null, configure: OutgoingContent.() -> Unit = {})

Responds to a client with a plain text response.

Link copied to clipboard
suspend fun ApplicationCall.respondTextWriter(contentType: ContentType? = null, status: HttpStatusCode? = null, writer: suspend Writer.() -> Unit)
suspend fun ApplicationCall.respondTextWriter(contentType: ContentType? = null, status: HttpStatusCode? = null, contentLength: Long? = null, writer: suspend Writer.() -> Unit)

Respond with text content writer.

Link copied to clipboard

Suppress response body compression plugin for this ApplicationCall.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
inline 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