采用hutool工具
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.3.5</version>
</dependency>
HashMap<String, Object> map = new HashMap<>();
String post = HttpUtil.post(url, map);
JSONObject jsonObject = new JSONObject(post);
String code = jsonObject.getStr("code");
tonken = jsonObject.getJSONObject("obj").getStr("accessToken");
List<T> rows = JSONUtil.toList(obj.getJSONArray(key), elementType);
JSONObject param= new JSONObject();
param.set("code", code);
param.set("page", page);
param.set("size", size);
String result = HttpRequest.get(url)
.header("api-key", tonken)
.form(param)
.execute().body();