pom依赖
<!--HttpClient的依赖-->
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<!--CloseableHttpClient的依赖-->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
HttpClient 的get请求方式
private static void doGet() {
HttpClient client = new HttpClient();
GetMethod getMethod = new GetMethod("https://www.thepaper.cn/");
int code = 0<