Hello Team, How do we suppose to parse this json using ktor client? ```{ "base": "xyz", "rates"...
d
Hello Team, How do we suppose to parse this json using ktor client?
Copy code
{
  "base": "xyz",
  "rates": {
    "AED": 3.67295,
    "AFN": 87.499995
  }
}
Copy code
@Serializable
class Obj(val base: String, val rates : Map<String?,Double>?)
I use kotlin serialization but observed following error
Copy code
io.ktor.client.call.NoTransformationFoundException: No transformation found: class io.ktor.utils.io.ByteBufferChannel (Kotlin reflection is not available) -> class dev.packge (Kotlin reflection is not available)
e
Hey, @dino9. Please take a look: https://ktor.io/docs/serialization-client.html
d
@e5l I have the setup as mentioned here : https://github.com/ktorio/ktor-documentation/blob/2.1.3/codeSnippets/snippets/client-json-kotlinx/src/main/kotlin/com/example/Application.kt
response.bodyAsText()
works fine to me but `response.body()`not working for json representation of map. is there any config i miss here?
e
It’s possible that backend doesn’t set the
Content-Type
header, could you install Logging to check it?