I tried to download a file with ktor-client and it...
# android
i
I tried to download a file with ktor-client and it failed, please help me https://paste.ubuntu.com/p/s9d68DBKgY/
t
Your code trying to convert the response to HttpHeaders doesn't make sense.
client.get<HttpResponse>(imageUrl) {
header("foo","bar")
}.let { res ->
when {
res.status == HttpStatusCode.OK ->
saveFile(imageFile, res.receive<ByteArray>())
else ->
println("get failed. ${res.status} $imageUrl")
}
}
i
@tateisu thanks