pom文件
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient-cache</artifactId>
<version>4.5</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.3.2</version>
</dependency>
一、使用get方式调用(返回json)
protected void service(HttpServletRequest request, HttpServletResponse response){
response.setCharacterEncoding("utf-8");
response.setContentType("application/json; charset=utf-8");
String urlS