String url = 'http://sbsfw.court.gov.cn/sbsfw/'; String result = ''; //创建httpclient对象 CloseableHttpClient httpclient = HttpClients.createDefault(); CloseableHttpResponse response = null; try { //创建httpget HttpGet httpget = new HttpGet(url); //执行get请求 response = httpclient.execute(httpget); //获取响应实体 HttpEntity entity = response.getEntity(); if (entity != null) { //按指定编码转换结果实体为String类型 result = EntityUtils.toString(entity, 'utf-8'); } EntityUtils.consume(entity); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { if (response != null) { response.close(); } httpclient.close(); } catch (IOException e) { e.printStackTrace(); } }

//result System.out.println(result); }

房地产租赁合同电子版下载 - 免费获取标准模板

原文地址: https://www.cveoy.top/t/topic/lmqw 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录