https://kotlinlang.org logo
#ktor
Title
# ktor
w

wouterdoeland

01/19/2018, 4:33 PM
I want to test my Ktor application, but for many requests I need to set some part of the post request body, how should I go about that? For example if I want to set the
data
post parameter, should I just use it like this:
Copy code
with(handleRequest(<http://HttpMethod.Post|HttpMethod.Post>, path, {
            body = "data=$data"
        })) {
            // test body
        }
c

cy

01/19/2018, 4:42 PM
Yes, but you can write your own extension function that does what you want