TestApplicationRequest

class TestApplicationRequest(call: TestApplicationCall, closeRequest: Boolean, method: HttpMethod, uri: String, version: String) : BaseApplicationRequest, CoroutineScope

Represents a test application request

Constructors

Link copied to clipboard
fun TestApplicationRequest(call: TestApplicationCall, closeRequest: Boolean, method: HttpMethod = HttpMethod.Get, uri: String = "/", version: String = "HTTP/1.1")

Functions

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

Add HTTP request header

Link copied to clipboard
open override fun receiveChannel(): ByteReadChannel

Properties

Link copied to clipboard
var bodyChannel: ByteReadChannel

Request body channel

Link copied to clipboard
override val call: ApplicationCall
Link copied to clipboard
open override val cookies: RequestCookies
Link copied to clipboard
open override val coroutineContext: CoroutineContext
Link copied to clipboard
open override val headers: Headers
Link copied to clipboard
open override val local: RequestConnectionPoint
Link copied to clipboard
var method: HttpMethod

HTTP method to be sent or executed

Link copied to clipboard
open override val pipeline: ApplicationReceivePipeline
Link copied to clipboard
var protocol: String

HTTP protocol to be used or was used

Link copied to clipboard
open override val queryParameters: Parameters
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)

Set HTTP request body text content

fun TestApplicationRequest.setBody(value: ByteArray)

Set HTTP request body bytes

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

Set multipart HTTP request body