I’ve got an endpoint that returns valid JSON with
Content-Type text/html; charset=UTF-8
. The response is as follows
{ "result": [ "foo", "bar" ] }
. When I try to serialize this into a POJO Ktor I get the following error:
No transformation found: class io.ktor.utils.io.ByteBufferChannel -> class FooList
This is most certainly about the wrong
Content-Type
, as with valid
application/json
header everything works as expected. Unfortunately, I cannot change the server’s headers.
Is there a workaround for this on client side? I tried with
accept(ContentType.Text.Plain)
as well as
accept(ContentType.Any)
but those don’t really help.