Created
August 8, 2014 23:06
-
-
Save bharath2020/7287ffe7a0a1225a316d to your computer and use it in GitHub Desktop.
HTTPUrlConnection redirect once
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
urlConnection = (HttpURLConnection) imageURL.openConnection(); | |
String location = urlConnection.getHeaderField("Location"); | |
if (location != null ) | |
{ | |
URL newURL = new URL(location); | |
urlConnection = (HttpURLConnection) newURL.openConnection(); | |
} | |
//use the urlConnection now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment