but what if you wanted to get the 'raw' json strin...
# ktor
w
but what if you wanted to get the 'raw' json string and parse it yourself. Is there a 'receiveRawText' type method?
d
Does
receiveChannel().readRemaining().readText(Charsets.UTF_8.newDecoder())
work? Maybe it is a bug (receiveText not working, or maybe it is intended)? Not sure.
If that works, you can create an extension method:
Copy code
suspend fun ApplicationCall.receiveRawText(): String = receiveChannel().readRemaining().readText(Charsets.UTF_8.newDecoder())
o
If you don’t want JSON transformations to kick in at all, you just don’t install ContentNegotiation. Or do you want it different in different endpoints? What’s the use case?
w
Its working now by consuming just once. @orangy there is no particular use case here I was just wondering about dumping the whole string 🙂