Hello. When I use ktor client to check my IP with any public API, the services close the connection. I can use all those services with with the browser or curl. Why is this happening?
Copy code
client.get<String>("<https://api.ipify.org>")
yields
java.io.IOException: Broken pipe
while
Copy code
client.get("<https://ktor.io/>")
works just fine.
Copy code
client.get<String>("<http://curlmyip.org/>")
causes
org.eclipse.jetty.io.EofException
I'm even impersonating curl:
Copy code
val client = HttpClient(Jetty) {
CurlUserAgent()
}
a
Aleksei Tirman [JB]
05/12/2021, 9:35 AM
That's because those endpoints don't support HTTP/2 (try