本文共 680 字,大约阅读时间需要 2 分钟。
org.jsoup jsoup
String url = "http://www.baidu.com";Connection conn = Jsoup.connect(url).method(Connection.Method.Get);Connection.Response response = connection.execute();System.out.println(response.body());
com.squareup.okhttp okhttp 2.7.5
String url = "http://www.baidu.com";OkHttpClient client = new OkHttpClient();Request request = new Request.Builder().get().url(url).build();Call call = client.newCall(request);Response response = call.execute();System.out.println(response.body().string());
转载地址:http://zlugf.baihongyu.com/