I use a secure synchronous URLConnection to request a webpage from a server (e.g. URLConnection.sendsync(GET, https://…, 20)
The response is an expected Redirect (httpstatus 302) with an unexpected http location (e.g. http://…). I would have thought the server would send an HTTPS redirect. Anyways, https is the location of the redirect, however, URLConnection automatically connects to http.
The same request in any browser works, meaning, it automatically redirects to https, not http.
Am I missing something with URLConnection? Should it not work the same was as the browser? (Meaning automatically redirect to https, or fallback to https)
Thanks!