rsetkus
10/24/2020, 7:36 PMio.ktor.client.call.NoTransformationFoundException: No transformation found: class io.ktor.utils.io.ByteChannelKt$ByteChannel$1 (Kotlin reflection is not available) -> class xxx.YYY (Kotlin reflection is not available)
with response from <https://XXX>:
status: 200 OK
response headers:
cache-control: max-age=600
, connection: keep-alive
, content-type: application/json;charset=utf-8
at io.ktor.client.call.HttpClientCall.receive(HttpClientCall.kt:84)
louiscad
10/24/2020, 7:50 PMrsetkus
10/24/2020, 7:57 PMio.ktor:ktor-client-android
louiscad
10/24/2020, 7:58 PMrsetkus
10/24/2020, 8:23 PMrequest<R>(path) {
this.method = methodType
this.headers.appendAll(headersSupplier())
this.body = body
}
to
val response = get<String>(path) {
this.headers.appendAll(headersSupplier())
}
Json.decodeFromString(R::class.serializer(), response)
serializes from string to type R
louiscad
10/24/2020, 8:50 PMJson
feature.rsetkus
10/24/2020, 9:10 PMJsonFeature
on common module? Do I need to include explicit dependency for it? Already included "org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.0"
io.ktor:ktor-client-json
and io.ktor:ktor-client-serialization
.
I find it quite hard to get around in Ktor docs. Found it on somebody's github.louiscad
10/24/2020, 11:40 PM