发送一个json 数据 向接口
default JSONArray getMyInfo(String requestUrl, String distCode) {
HttpRequest request = HttpUtil.createPost(requestUrl);
String type = distMyLevel(distCode);
Map<String, Object> body = new MyHashMap<String, Object>().myPut("type", type).myPut("code", distCode);
request.body(JSON.toJSONString(body));
HttpResponse response = request.execute();
if (STATUS_CODE_SUCCESS == response.getStatus()) {
JSONObject json = JSON.parseObject(response.body());
return json.getJSONArray("data");
}
throw new RuntimeException("DMS_DISTCODE_QUERY_URL request fail");
}
HashMap<String, Object> paramMap = new HashMap<>();
paramMap.put("file", FileUtil.file(imgRealPath));
String result= HttpUtil.post(appInternet, paramMap);
JSONObject jsonObject = JSONObject.parseObject(result);