Map maps=new HashMap<>(); //创建hashmap的对象
maps.put("开始时间",startTime); //用这个对象去使用put方法,将startTime和endTime通过key values值的方式添加到maps中
maps.put("结束时间",endTime);
new AppConnectInfo().goTestInfo("51", "4", "save", maps); //最后就可以直接用了
这里是发送HTTP请求的地方
public String goTestInfo(String id, String num, String wheres, Map<String, String> map) throws Exception {
Map<String, String> bundle = new HashMap<>();
bundle.put(“功能序号”, id);
bundle.put(“业务序号”, num);
bundle.put(“操作类型”, wheres);
bundle.put(“args”, JSON.toJSONString(map)); //map的内容传到这里来
String url = SERVER_DOMAIN + “/terminal/api/facade/demo”;
String reString = requestProtocol(url, reSetParmas(bundle), HttpUtility.HTTPMETHOD_POST);
return reString;
}