TestApplicationCall
class TestApplicationCall :
BaseApplicationCall,
CoroutineScope
Represents a test application call that is used in withTestApplication and handleRequest
Constructors
TestApplicationCall( Represents a test application call that is used in withTestApplication and handleRequest |
Properties
val coroutineContext: <ERROR CLASS> |
|
val request: TestApplicationRequest Client request |
|
var requestHandled: Boolean Set to |
|
val response: TestApplicationResponse Server response |
Inherited Properties
val application: Application Application being called |
|
val attributes: Attributes Attributes attached to this instance |
|
open val parameters: Parameters Parameters associated with this call |
Functions
fun toString(): String |
Inherited Functions
fun putResponseAttribute( Put engine response attribute. This is required for base implementation to work properly |
Extension Properties
val ApplicationCall.authentication: AuthenticationContext Retrieves an AuthenticationContext for |
|
val ApplicationCall.callId: String? A call id that is retrieved or generated by CallId feature or |
|
val ApplicationCall.locations: Locations Gets the Application.locations feature |
|
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 |
Extension Functions
fun CoroutineScope. fun CoroutineScope.decodeChunked( Start a chunked stream decoder coroutine |
|
fun ApplicationCall.defaultTextContentType( Creates a default ContentType based on the given contentType and current call |
|
fun ApplicationCall.digestAuthenticationCredentials(): DigestCredential? Retrieves DigestCredential from this call |
|
fun <TEngine : ApplicationEngine, TConfiguration : Configuration> CoroutineScope.embeddedServer( Creates an embedded server with the given factory, listening on host:port |
|
fun CoroutineScope.httpServer( Start an http server with settings invoking handler for every request |
|
fun CoroutineScope. Start an http server with settings invoking handler for every request |
|
fun <T : Any> ApplicationCall.locationOrNull(): T Retrieves the current call’s location or |
|
fun CoroutineScope.mapEngineExceptions( Returns ByteReadChannel with ByteChannel.close handler that returns SocketTimeoutException instead of SocketTimeoutException. fun CoroutineScope.mapEngineExceptions( Returns ByteWriteChannel with ByteChannel.close handler that returns SocketTimeoutException instead of SocketTimeoutException. |
|
fun CoroutineScope.parseMultipart( fun CoroutineScope.parseMultipart( fun CoroutineScope. Starts a multipart parser coroutine producing multipart events |
|
fun CoroutineScope.pinger( Launch pinger coroutine on CoroutineScope that is sending ping every specified period to outgoing channel, waiting for and verifying client’s pong frames. It is also handling timeout and sending timeout close frame fun CoroutineScope.pinger( Launch pinger coroutine on CoroutineScope that is sending ping every specified periodMillis to outgoing channel, waiting for and verifying client’s pong frames. It is also handling timeoutMillis and sending timeout close frame |
|
fun CoroutineScope.pinger( Launch pinger coroutine on CoroutineScope that is sending ping every specified period to outgoing channel, waiting for and verifying client’s pong frames. It is also handling timeout and sending timeout close frame |
|
fun CoroutineScope.ponger( Launch a ponger actor job on the CoroutineScope sending pongs to outgoing channel. It is acting for every client’s ping frame and replying with corresponding pong |
|
fun <P : Principal> ApplicationCall.principal(): P? Retrieves authenticated Principal for |
|
fun ApplicationCall.push(pathAndQuery: String): Unit fun ApplicationCall.push( 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( 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.putServletAttributes( |
|
fun CoroutineScope.reader( fun CoroutineScope.reader( |
|
suspend fun <T : Any> ApplicationCall.receive(): T suspend fun <T : Any> ApplicationCall.receive( 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( suspend fun <T : Any> ApplicationCall.receiveOrNull( 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( |
|
suspend fun <T : Any> ApplicationCall.respond( suspend fun ApplicationCall. Sends a message as a response suspend fun <T : Any> ApplicationCall.respond( suspend fun ApplicationCall. |
|
suspend fun ApplicationCall.respondBytes( Responds to a client with a raw bytes response, using specified provider to build a byte array suspend fun ApplicationCall.respondBytes( Responds to a client with a raw bytes response, using specified bytes |
|
suspend fun ApplicationCall.respondBytesWriter( Respond with binary content producer. |
|
suspend fun ApplicationCall.respondFile( Responds to a client with a contents of a file with the name fileName in the baseDir folder suspend fun ApplicationCall.respondFile( Responds to a client with a contents of a file |
|
suspend fun ApplicationCall.respondHtml( Responds to a client with a HTML response, using specified block to build an HTML page |
|
suspend fun <TTemplate : Template<HTML>> ApplicationCall.respondHtmlTemplate( |
|
suspend fun ApplicationCall.respondOutputStream( Respond with binary content producer. |
|
suspend fun ApplicationCall.respondRedirect( Responds to a client with a suspend fun ApplicationCall.respondRedirect( Responds to a client with a |
|
suspend fun ApplicationCall.respondTemplate( |
|
suspend fun ApplicationCall.respondText( Responds to a client with a plain text response, using specified text suspend fun ApplicationCall.respondText( Responds to a client with a plain text response, using specified provider to build a text |
|
suspend fun ApplicationCall.respondTextWriter( Respond with text content writer. |
|
fun <SessionType : Any> ApplicationCall.sessionId(): String? Returns the corresponding session ID for the type SessionType or |
|
fun CoroutineScope. Start connection HTTP pipeline invoking handler for every request. Note that handler could be invoked multiple times concurrently due to HTTP pipeline nature |
|
fun CoroutineScope.startServerConnectionPipeline( Start connection HTTP pipeline invoking handler for every request. Note that handler could be invoked multiple times concurrently due to HTTP pipeline nature |
|
fun ApplicationCall.suitableCharset( Detect suitable charset for an application call by |
|
fun ApplicationCall.url( Constructs a String with the url of a instance location whose class must be annotated with Location. |
|
fun ApplicationCall.url( 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 |
|
fun CoroutineScope. Start multirange response writer coroutine |
|
fun CoroutineScope.writer( fun CoroutineScope.writer( |