has been a while since i checked, but can ktor htt...
# ktor
n
has been a while since i checked, but can ktor httpclient now do streaming requests ? keeping the connection open and allowing me to process the chunks (of json) coming in
c
Yes (not sure about ios)
but you'll need to parse json yourself
n
thats absolutely fine
c
You can simply get ByteReadChannel instead of String
Or get a channel from
HttpResponse
n
is this what you mean?
client.get<ByteReadChannel>("<http://127.0.0.1:8080/>")
?
c
Yes, or
get<HttpResponse>("...").use { it.content .... }
n
but the chunks might come in delayed.. or rather .. the server only sends more chunks as more things happen
so this will not close on me right ?
c
It shouldn't unless some kind timeout on server side
n
okay cool ,that helps a lot
i have tried
client.get<ByteReadChannel>
but almost all operations on the channel result in
Exception in thread "main" java.lang.IllegalStateException: Operation is already in progress