New to Java HTTP requests, and can't sort out how to decode the input stream. It's a simple GET, so as per the advice here, I'm using the following code:
public void setupIPCheck() throws IOException {
URLConnection connection = new URL("http://freegeoip.net/json/").openConnection();
InputStream response = connection.getInputStream();
Log.d("IPcheck", response.toString());
}
I'm expecting a JSON blob - do I have to read every byte from the stream manually? I'm developing for android, so I can't use IOUtils.