Ifvwm
01/14/2021, 6:07 AMhttpClient.put<ByteArray>(realUrl){
body = "aha".toByteArray()
}
this code can upload data to a link, now I need to get upload progress, how to use a outputStream to instead of this way to upload data?
val _outputStream = httpClient.put<HttpResponse>(realUrl)
val outputStream = _outputStream.receive<OutputStream>()
outputStream.write("abc".toByteArray())
outputStream.flush()
outputStream.close()
this won't work, error message o.ktor.client.call.NoTransformationFoundException: No transformation found: class io.ktor.utils.io.ByteBufferChannel (Kotlin reflection is not available) -> class java.io.OutputStream (Kotlin reflection is not available)gildor
01/14/2021, 6:27 AMgildor
01/14/2021, 6:28 AMgildor
01/14/2021, 6:29 AMIfvwm
01/14/2021, 6:44 AMval aa = httpClient.put<HttpResponse>(realUrl)
val ab = aa.receive<ByteWriteChannel>()
ab.write("abc")
ab.flush()
val ac = httpClient.put<ByteWriteChannel>(realUrl)
ac.write("abc")
ac.flush()
like this? there're no much info on that doc