Example #1
0
 private static String downloadPage(final String url, final String referer) {
   try {
     final HttpURLConnection con = HttpClient.getHttpConnection(new URL(url));
     if (referer != null && !referer.isEmpty()) con.addRequestProperty("Referer", referer);
     return HttpClient.downloadAsString(con);
   } catch (final IOException e) {
     e.printStackTrace();
     return "";
   }
 }