使用 HTTPClient 下载数据
Download Data Using HTTPClient
对使用 Apache HTTPClient 有疑问。我需要从网站提取数据并找到这个有用的教程 https://hc.apache.org/httpclient-3.x/tutorial.html
教程中说我们将编写一个 "downloads a page" 的简单应用程序。
它 "download" 页面的确切位置是什么?我没有看到提到正在设置数据库或一些云存储或诸如此类的东西所以信息 "go" 到底在哪里(或者一旦数据被拉出,它被保存在哪里)?我对 Java 有点陌生,所以这有点概念化
"download" 转到 System.out
:
// Read the response body.
byte[] responseBody = method.getResponseBody();
// Deal with the response.
// Use caution: ensure correct character encoding and is not binary data
System.out.println(new String(responseBody));
对使用 Apache HTTPClient 有疑问。我需要从网站提取数据并找到这个有用的教程 https://hc.apache.org/httpclient-3.x/tutorial.html
教程中说我们将编写一个 "downloads a page" 的简单应用程序。
它 "download" 页面的确切位置是什么?我没有看到提到正在设置数据库或一些云存储或诸如此类的东西所以信息 "go" 到底在哪里(或者一旦数据被拉出,它被保存在哪里)?我对 Java 有点陌生,所以这有点概念化
"download" 转到 System.out
:
// Read the response body.
byte[] responseBody = method.getResponseBody();
// Deal with the response.
// Use caution: ensure correct character encoding and is not binary data
System.out.println(new String(responseBody));