问题
I just found out that Android's recommended http client HttpUrlConnection
doesn't support HTTP/2.
Is there a specific reason not to use HTTP/2 on Android?
回答1:
You can use OkHttp if you want to take advantage of HTTP/2:
https://github.com/square/okhttp
It's superior to HttpUrlConnection anyway. If you're doing anything at all complicated, like getting complex JSON responses from a web API, I'd recommend Retrofit:
https://square.github.io/retrofit/
来源:https://stackoverflow.com/questions/52671739/why-http-2-is-not-supported-by-androids-httpurlconnection