httpClient.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?
Copy code
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)
val 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()