Here you can find the source of httpGetString(String url)
public static String httpGetString(String url) throws IOException
//package com.java2s; //License from project: LGPL import java.io.*; import java.net.HttpURLConnection; import java.net.URL; public class Main { public static String httpGetString(String url) throws IOException { StringBuilder result = new StringBuilder(); HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection(); conn.setRequestMethod("GET"); BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line;/* w w w . j av a2 s .c o m*/ while ((line = rd.readLine()) != null) { result.append(line); } rd.close(); return result.toString(); } }