Skip to content

Instantly share code, notes, and snippets.

@davidllorca
Created July 14, 2015 15:05
Show Gist options
  • Save davidllorca/59de9bb45d5385485dc8 to your computer and use it in GitHub Desktop.
Save davidllorca/59de9bb45d5385485dc8 to your computer and use it in GitHub Desktop.
try {
URL url = new URL("http://myserver.com/myservice");
StringBuffer strBuff = new StringBuffer();
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream(), "ISO-8859-1"));
String str;
while((str = in.readLine()) != null){
strBuff.append(str);
}
in.close()
} catch (Exception e){
e.printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment