Hi guys, i have question regarding a HttpClient qu...
# ktor
j
Hi guys, i have question regarding a HttpClient query which is returning a TooLongLineException. Is there any way to fix this issue in ktor? It seems there is a but raised for it https://youtrack.jetbrains.com/issue/KTOR-2588/ByteReadChannel-is-unable-to-read-files-with-long-lines
Copy code
"i.k.u.i.c.TooLongLineException: Line is longer than limit\n\tat i.k.u.i.ByteBufferChannel$readUTF8LineToUtf8Suspend$2.invokeSuspend(ByteBufferChannel.kt:2094)\n\tat i.k.u.i.ByteBufferChannel$readUTF8LineToUtf8Suspend$2.invoke(ByteBufferChannel.kt)\n\tat i.k.u.i.ByteBufferChannel$readUTF8LineToUtf8Suspend$2.invoke(ByteBufferChannel.kt)\n\tat i.k.u.i.ByteBufferChannel.lookAheadSuspend$suspendImpl(ByteBufferChannel.kt:1826)\n\tat i.k.u.i.ByteBufferChannel.lookAheadSuspend(ByteBufferChannel.kt)\n\tat i.k.u.i.ByteBufferChannel.readUTF8LineToUtf8Suspend(ByteBufferChannel.kt:2076)\n\tat i.k.u.i.ByteBufferChannel.readUTF8LineToAscii(ByteBufferChannel.kt:2011)\n\tat i.k.u.i.ByteBufferChannel.readUTF8LineTo$suspendImpl(ByteBufferChannel.kt:2113)\n\tat i.k.u.i.ByteBufferChannel.readUTF8LineTo(ByteBufferChannel.kt)\n\tat i.k.u.i.ByteBufferChannel.readUTF8Line$suspendImpl(ByteBufferChannel.kt:2117)\n\tat i.k.u.i.ByteBufferChannel.readUTF8Line(ByteBufferChannel.kt)\n\t
I fixed it by changing the way i read the response =>
Copy code
return json.decodeFromString(httpResponse.readText())