HttpsUrlConnection and keep-alive
I ran into this exact same problem and finally have a solution after some in-depth debugging. Http(s)UrlConnection does handle Keep-Alive by default but sockets must be in a very specific condition in order to be reused. These are: Input streams must be fully consumed. You must call read on the input stream until it returns … Read more