Skip to content

Instantly share code, notes, and snippets.

@matthewmorrone
Created November 12, 2019 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewmorrone/871b2e1529cee56c03d41f741d0e7123 to your computer and use it in GitHub Desktop.
Save matthewmorrone/871b2e1529cee56c03d41f741d0e7123 to your computer and use it in GitHub Desktop.
public static InputStream getInputStreamFromUrl(String url) {
InputStream content = null;
try {
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(new HttpGet(url));
content = response.getEntity().getContent();
} catch (Exception e) {
Log.("[GET REQUEST]", "Network exception", e);
}
return content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment