Here you can find the source of readGetEx(String url)
public static String readGetEx(String url) throws MalformedURLException, IOException
//package com.java2s; /*/*from w w w. j ava2 s. c o m*/ * Copyright 2014-2016 IvaLab Inc. and contributors below * * Released under the LGPL v3 or higher * See http://www.gnu.org/licenses/lgpl.txt * * Date: 2014-10-02 * * Contributors: * * Igor Peonte <igor.144@gmail.com> * */ import java.io.*; import java.net.*; public class Main { public static String readGetEx(String url) throws MalformedURLException, IOException { String res = ""; BufferedReader reader = null; try { HttpURLConnection conn; conn = (HttpURLConnection) (new URL(url)).openConnection(); reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line; while ((line = reader.readLine()) != null) res += line; } finally { if (reader != null) reader.close(); } return res; } }