TestApplicationRequest

class TestApplicationRequest(call: TestApplicationCall, closeRequest: Boolean, method: <ERROR CLASS>, uri: String, port: Int?, version: String) : CoroutineScope

A test application request

Constructors

Link copied to clipboard
fun TestApplicationRequest(call: TestApplicationCall, closeRequest: Boolean, method: <ERROR CLASS> = HttpMethod.Get, uri: String = "/", port: Int? = null, version: String = "HTTP/1.1")

Functions

Link copied to clipboard
fun addHeader(name: String, value: String)

Adds an HTTP request header.

Link copied to clipboard
open fun receiveChannel(): <ERROR CLASS>

Properties

Link copied to clipboard
var bodyChannel: <ERROR CLASS>

Request body channel.

Link copied to clipboard
open val cookies: <ERROR CLASS>
Link copied to clipboard
open override val coroutineContext: CoroutineContext
Link copied to clipboard
open val headers: <ERROR CLASS>
Link copied to clipboard
open val local: <ERROR CLASS>
Link copied to clipboard
var method: <ERROR CLASS>

HTTP method to be sent or executed

Link copied to clipboard
var port: Int?

(Optional) HTTP port to send request to

Link copied to clipboard
var protocol: String

HTTP protocol to be used or was used

Link copied to clipboard
open val queryParameters: <ERROR CLASS>
Link copied to clipboard
open val rawQueryParameters: <ERROR CLASS>
Link copied to clipboard
var uri: String

HTTP url to sent request to or was sent to

Link copied to clipboard
var version: String

HTTP version to sent or executed

Extensions

Link copied to clipboard
fun TestApplicationRequest.setBody(value: String)

Sets an HTTP request body text content.

fun TestApplicationRequest.setBody(value: ByteArray)

Sets an HTTP request body bytes.

fun TestApplicationRequest.setBody(value: <ERROR CLASS>)

Set HTTP request body from ByteReadPacket

fun TestApplicationRequest.setBody(boundary: String, parts: List<<ERROR CLASS>>)

Sets a multipart HTTP request body.