ericksli
06/30/2024, 3:01 PMval res = httpClient.get("<https://example.com>").bodyAsText()
println(res)
The Process finished with exit code 0
will show up after ~1 min of printing out the response body
It does not help even I call httpClient.close()
afterwards
What is the reason why it takes so much time to finish the program?ericksli
06/30/2024, 3:04 PMChrimaeon
06/30/2024, 3:18 PMericksli
06/30/2024, 3:20 PMChrimaeon
06/30/2024, 3:22 PMericksli
06/30/2024, 3:29 PMokhttpClient.newCall(Request.Builder().url("<https://example.com>").method("GET", null).build()).execute().use {
println(it.body?.string())
}
The Process finished with exit code 0
prints out quickly after printing out the response body.
Looks like an issue in Ktor clientAleksei Tirman [JB]
06/30/2024, 8:04 PMericksli
07/01/2024, 2:27 AMhttpClient.close()
does not helpephemient
07/01/2024, 4:07 AMokHttpClient.shutdown()
ericksli
07/01/2024, 6:03 AMAleksei Tirman [JB]
07/01/2024, 11:06 AMval client = HttpClient(OkHttp)
client.get("<https://httpbin.org/get>")
client.close()