Nicolas Bourdin
08/27/2020, 9:37 AMgotoOla
08/28/2020, 8:54 AMval response = <http://httpClient.post|httpClient.post><HttpResponse>("$localServerUrl/searches") {
body = TextContent(request.toJsonString(), ContentType.Application.Json)
accept(ContentType.Application.Json)
}
response.readText()
// throws io.ktor.client.call.NoTransformationFoundException: No transformation found: class kotlinx.coroutines.io.ByteBufferChannel -> class io.ktor.utils.io.core.Input
mserralta
08/28/2020, 12:00 PMNicolas Bourdin
08/28/2020, 1:07 PMval message = httpResponse.content.readText(
httpResponse.contentType()?.charset() ?: Charsets.UTF_8)
private suspend inline fun ByteReadChannel.readText(charset: Charset): String =
readRemaining().readText(charset = charset)
gotoOla
08/28/2020, 1:48 PMmserralta
08/31/2020, 8:34 AM