Map<String, String > heads = new HashMap<>();
List<Co> CoList = new ArrayList<>();
heads = new HashMap<>();
// 使用json发送请求,下面的是必须的
heads.put("Content-Type", "application/json;charset=UTF-8");
/**
** headerMap是添加的请求头,
body是传入的参数,这里选择json,后端使用@RequestBody接收
*/
HttpResponse response = HttpRequest.get("http://localhost:8082/acvb/Device/Co")
.headerMap(heads, false)
.body(JSONUtil.toJsonStr(CoList))
.timeout(5 * 60 * 1000)
.execute();
JSONObject jsonObject = JSONObject.parseObject(response.body());
CoList = BeanUtil.copyToList(jsonObject.getJSONArray("data"), Co.class);
无token两个系统对接数据
最新推荐文章于 2024-08-17 17:39:04 发布