Computer scienceBackendKtorAdvanced Ktor

Ktor Testing

Send Json

Report a typo

Write the code that will send the request with the body book:

@Test
fun testRegistration() = testApplication {
    // previous configuration
    client.post("/book") {
        contentType(ContentType.Application.Json)
        val book = Book(title = "Learning Ktor in 2 weeks")
        /* your code here */
    }
}
Enter a short text

Create a free account to access the full topic