My android app faced crash issue with NoTransforma...
# ktor
y
My android app faced crash issue with NoTransformationFoundException.
Copy code
io.ktor.client.call.NoTransformationFoundException: Expected response body of the type 'class MyClass' but was 'class io.ktor.utils.io.SourceByteReadChannel'

Response header `ContentType: application/octet-stream` 
Request header `Accept: application/json`
My ktor setup is here:
Copy code
@Provides
@Singleton
fun provideHttpClient(): HttpClient {
    return HttpClient(Android) {
        install(ContentNegotiation) {
            json(Json {
                ignoreUnknownKeys = true
            })
        }
    }
}
I am using Ktor 3.0.0 I tried to set "header("ContentType", "application/json")" but it doesn't work... What can I do to solve this issue?
a
Can you share the definition of the
MyClass
and the code where the request is made?