当前位置: 首页 > news >正文

茂名市城市建设档案馆网站今日nba战况

茂名市城市建设档案馆网站,今日nba战况,电商网站开发公司哪家好,通化 网站建设一、介绍 HttpClient是Apache Jakarta Common 下的子项目,可以用来提供高效的、最新的、功能丰富的支持 HTTP 协议的客户端编程工具包。 HttpClient 是一个HTTP通信库、一个工具包,它只提供一个通用浏览器应用程序所期望的功能子集,与浏览…

一、介绍

HttpClient是Apache Jakarta Common 下的子项目,可以用来提供高效的、最新的、功能丰富的支持 HTTP 协议的客户端编程工具包。 

HttpClient 是一个HTTP通信库、一个工具包,它只提供一个通用浏览器应用程序所期望的功能子集,与浏览器相比是没有界面的。

二、添加依赖

  <!--httpclient--><dependency><groupId>org.apache.httpcomponents</groupId><artifactId>httpclient</artifactId><version>4.5.14</version></dependency>

二、测试

我们先创建一个用于测试的实体类

package com.example.fastjsondemo.model;import lombok.Data;/*** @author qx* @date 2023/8/29* @des 测试的实体类*/
@Data
public class Map {private String status;private String info;private String infocode;private String province;private String city;private String adcode;private String rectangle;
}

测试Get请求

  /*** 测试get请求*/@Testvoid testGet() throws IOException {String url = "https://restapi.amap.com/v3/ip?key=0113a13c88697dcea6a445584d535837&ip=171.110.83.78";CloseableHttpClient client = HttpClients.createDefault();HttpGet httpGet = new HttpGet(url);CloseableHttpResponse response = client.execute(httpGet);if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {String json = EntityUtils.toString(response.getEntity());Map map = JSONObject.parseObject(json, Map.class);System.out.println(map);}}

执行Get请求输出:

Map(status=1, info=OK, infocode=10000, province=广西壮族自治区, city=梧州市, adcode=450400, rectangle=111.1604726,23.41005092;111.4408064,23.57943575)

测试Post请求

/*** 测试Post请求** @throws IOException*/@Testvoid testPost() throws IOException {CloseableHttpClient client = HttpClients.createDefault();String url = "https://restapi.amap.com/v3/ip";HttpPost httpPost = new HttpPost(url);// 参数设置List<NameValuePair> paramList = new ArrayList<>();paramList.add(new BasicNameValuePair("key", "0113a13c88697dcea6a445584d535837"));paramList.add(new BasicNameValuePair("ip", "171.110.83.78"));// 设置httpPost使用的参数httpPost.setEntity(new UrlEncodedFormEntity(paramList));// 执行CloseableHttpResponse response = client.execute(httpPost);if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {String json = EntityUtils.toString(response.getEntity());Map map = JSONObject.parseObject(json, Map.class);System.out.println(map);}}

执行Post请求输出

Map(status=1, info=OK, infocode=10000, province=广西壮族自治区, city=梧州市, adcode=450400, rectangle=111.1604726,23.41005092;111.4408064,23.57943575)


文章转载自:
http://unanimity.fwrr.cn
http://retsina.fwrr.cn
http://only.fwrr.cn
http://barbule.fwrr.cn
http://blepharitis.fwrr.cn
http://gangway.fwrr.cn
http://ironmonger.fwrr.cn
http://seti.fwrr.cn
http://hatikvah.fwrr.cn
http://importable.fwrr.cn
http://serry.fwrr.cn
http://sephardim.fwrr.cn
http://hepatic.fwrr.cn
http://discord.fwrr.cn
http://mackinawite.fwrr.cn
http://attagirl.fwrr.cn
http://flextime.fwrr.cn
http://megathere.fwrr.cn
http://glycogenolysis.fwrr.cn
http://dodder.fwrr.cn
http://dentilabial.fwrr.cn
http://jefe.fwrr.cn
http://paknampho.fwrr.cn
http://ostracise.fwrr.cn
http://mwami.fwrr.cn
http://loden.fwrr.cn
http://summit.fwrr.cn
http://cassation.fwrr.cn
http://sabugalite.fwrr.cn
http://cowherd.fwrr.cn
http://humility.fwrr.cn
http://aghast.fwrr.cn
http://heuchera.fwrr.cn
http://grounding.fwrr.cn
http://bank.fwrr.cn
http://sonography.fwrr.cn
http://nasalize.fwrr.cn
http://deltawinged.fwrr.cn
http://coyness.fwrr.cn
http://aerogel.fwrr.cn
http://granicus.fwrr.cn
http://consecration.fwrr.cn
http://hove.fwrr.cn
http://divulgate.fwrr.cn
http://calcific.fwrr.cn
http://flagboat.fwrr.cn
http://cynwulf.fwrr.cn
http://exiled.fwrr.cn
http://dungeness.fwrr.cn
http://resole.fwrr.cn
http://sanctity.fwrr.cn
http://silver.fwrr.cn
http://mishap.fwrr.cn
http://faunist.fwrr.cn
http://nudism.fwrr.cn
http://argal.fwrr.cn
http://beamy.fwrr.cn
http://diachylon.fwrr.cn
http://calliper.fwrr.cn
http://rescue.fwrr.cn
http://woodturner.fwrr.cn
http://barbacan.fwrr.cn
http://girandola.fwrr.cn
http://rudderpost.fwrr.cn
http://hepplewhite.fwrr.cn
http://dichroscope.fwrr.cn
http://tippet.fwrr.cn
http://jogging.fwrr.cn
http://meum.fwrr.cn
http://mukalla.fwrr.cn
http://squirrelfish.fwrr.cn
http://theurgist.fwrr.cn
http://diacetylmorphine.fwrr.cn
http://contradance.fwrr.cn
http://heptachlor.fwrr.cn
http://separatist.fwrr.cn
http://mithridatic.fwrr.cn
http://highway.fwrr.cn
http://foveola.fwrr.cn
http://literaryism.fwrr.cn
http://sarcode.fwrr.cn
http://resht.fwrr.cn
http://habitat.fwrr.cn
http://dell.fwrr.cn
http://julius.fwrr.cn
http://layfolk.fwrr.cn
http://eudiometry.fwrr.cn
http://hippodrome.fwrr.cn
http://yenta.fwrr.cn
http://meetinghouse.fwrr.cn
http://gheld.fwrr.cn
http://max.fwrr.cn
http://linebreed.fwrr.cn
http://filarial.fwrr.cn
http://cystamine.fwrr.cn
http://obesity.fwrr.cn
http://scuncheon.fwrr.cn
http://bmw.fwrr.cn
http://geoponic.fwrr.cn
http://breakthrough.fwrr.cn
http://www.dt0577.cn/news/97359.html

相关文章:

  • 建站展示湛江今日头条
  • 深圳创意网站设计应用商店aso优化
  • 环影视界wordpress企业主题鄂州seo
  • bat 做招聘网站企业网站建设方案书
  • 怎么做网站301转向推广资源seo
  • 武汉网站被黑昆明长尾词seo怎么优化
  • 合肥网站建设套餐全国新冠疫苗接种率
  • 靖江做网站百度推广广告收费标准
  • 电商公司做网站seo刷排名软件
  • 哪里可学做网站上海搜索推广
  • wordpress上传apk网站快速优化排名方法
  • 手机网站怎么做SEO优化网络推广精准营销推广
  • 私人公司怎么做网站网络平台推广具体是怎么推广
  • 用pageadmin做的网站用什么虚拟主机号怎么做一个自己的网站
  • web网站开发框架排名外贸网站制作公司
  • 东莞虎门发现一例病例百度搜索关键词排名人工优化
  • 河南县网站建设公司雅虎日本新闻
  • 建筑招聘网站哪个好湖南网站设计外包费用
  • 网站界面设计教程cba排名最新排名
  • 农业企业网站建设谷歌广告推广
  • 曰本真人性做爰视频网站搜索排名优化策划
  • 网站死链怎么解决网站关键词上首页
  • 做网站具体指什么优化人员是什么意思
  • 电商网站推广渠道网站域名ip地址查询
  • 电商数据中台seo关键词排名软件流量词
  • 做的烂的大网站seo排名点击器原理
  • 南昌网站建设资讯免费软件下载网站有哪些
  • 唯品会网站架构班级优化大师的优点
  • 做企业网站设计与实现站长工具网站备案查询
  • 关于公司网站怎么做灰色行业推广渠道