public static String get(String inputStr) throws Exception {
URL url = new URL(inputStr);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setConnectTimeout(5000);
InputStream stream = connection.getInputStream();
String intStr = getInputStr(stream);
return intStr;
}
public static String getInputStr(InputStream stream) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
StringBuffer buffer = new StringBuffer();
String con=null;
while((con=reader.readLine())!=null){
buffer.append(con);
}
return buffer.toString();
}