bodo
04/01/2023, 2:57 PM@Serializable
@SerialName("modules")
data class Modules(
val resId: String?,
val contentUrl: String?,
)
val httpClient = HttpClient(Android) {
install(ContentNegotiation) {
xml()
}
}
lifecycleScope.launch {
val modules = httpClient.get("...").body<Modules>()
Log.d("MODULES", modules.toString())
}
But when i do the httpClient.get(url).body<Modules>()
i get the following error. can you please tell me what i am doing wrong.
io.ktor.client.call.NoTransformationFoundException: No transformation found: class io.ktor.utils.io.ByteBufferChannel -> class com.example.ktor.Modules
Aleksei Tirman [JB]
04/03/2023, 9:21 AMContent-Type
the server replies to the client?bodo
04/03/2023, 6:34 PMApplication/Xml
. But the server returns Text/Xml
. But now i get an error because i did not define every property in my data model. Is there a possibility to ignore unknown properties?Aleksei Tirman [JB]
04/04/2023, 4:28 AMbodo
04/06/2023, 8:00 AM