Hi, I’m using Ktor Client and MockEngine as per <h...
# ktor
t
Hi, I’m using Ktor Client and MockEngine as per https://ktor.io/clients/http-client/testing.html. I’d like to check the request body that is being generated. How can I get the full body? I’ve tried request.body.toString() but that returns a concatenated version.
1
c
body
is an
OutgoingContent
that couldn't be stringified just like that. Try
request.body.toByteArray().toString(Charsets.UTF_8)
Note that depending on
OutgoingContent
kind, sometimes it could be consumed only once
t
perfect, thanks!