createClient
open override fun createClient(block: <ERROR CLASS><out <ERROR CLASS>>.() -> Unit): <ERROR CLASS>
Content copied to clipboard
Creates a client with a custom configuration. For example, to send JSON data in a test POST/PUT request, you can install the ContentNegotiation
plugin:
fun testPostCustomer() = testApplication {
val client = createClient {
install(ContentNegotiation) {
json()
}
}
}
Content copied to clipboard