I have some url and i need to download file from it.
In some cases i got 301 redirect, and in some cases it redirects me to HTTPS url (for example, this is real http url that redirects to https: http://bit.ly/1laNsED)
I don't know in advance what i will get from this url - actual file, 301 redirect or 301 redirect to HTTPS.
How i can correctly handle this situation in Android?
UPDATE: Solved this issue with OkHttp.