Skip to content

Instantly share code, notes, and snippets.

@bharath2020
bharath2020 / gist:7287ffe7a0a1225a316d
Created August 8, 2014 23:06
HTTPUrlConnection redirect once
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
@bharath2020
bharath2020 / 0_reuse_code.js
Created January 24, 2014 00:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console