why take a HttpResponse from a download link would...
# ktor
i
why take a HttpResponse from a download link would take a long time?
Copy code
val client = HttpClient(CIO) {
        followRedirects = false
    }
        val _result = client.get<HttpResponse>(addr)
        val readInputStream = client.get<InputStream>(_result.headers["LOCATION"]?:"")
//        val count = client.get<HttpResponse>(_result.headers["LOCATION"]?:"")
the comment line would take 20 seconds
g
do you have any reproduction for this?
r
client.get<HttpResponse>
downloads and saves in memory body of the response. If you don’t need it, use
client.get<HttpStatement>().execute { /* you can read body here */ }
👍 1