How would I go about streaming an octet-stream to ...
# ktor
s
How would I go about streaming an octet-stream to a file with ktor-client-okhttp?
d
With
client
being any
io.ktor.client.HttpClient
, the following should do it:
Copy code
FileChannel.open(<path>, StandardOpenOption.WRITE).use { fc ->
  client.call { ... }.response.content.copyTo(fc)
}
👍 1