Created
February 15, 2015 09:57
-
-
Save ehgoodenough/54447ea9e164ce1724fd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import java.net.URLConnection; | |
import java.net.URL; | |
import java.net.MalformedURLException; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.BufferedReader; | |
public class HTTPtest | |
{ | |
public static void main(String[] args) throws MalformedURLException, IOException | |
{ | |
URLConnection connection = new URL("http://leveledup.io/users/andrew/untz").openConnection(); | |
connection.setRequestProperty("Accept-Charset", "UTF-8"); | |
InputStream response = connection.getInputStream(); | |
BufferedReader responseReader = new BufferedReader(new InputStreamReader(response)); | |
System.out.println(responseReader.readLine()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment