String username = "test";
String password = MD5Utils.md5Value("123456").toUpperCase();
String tradeno = System.currentTimeMillis() + "";
String sign = MD5Utils.md5Value(username + password + tradeno).toUpperCase();
Map<String, Object> param = new HashMap<>();
param.put("username", username);
param.put("sign", sign);
param.put("password", password);
param.put("tradeno", tradeno);
String json = JSONUtil.toJsonStr(param);
System.out.println(json);
String result = HttpRequest.post("http://www.xxxxxx.com:8088/cmsapi/userLogin")
.body(json)
.execute().body();
System.out.println(result);
hutool工具包发送restful请求
于 2022-10-09 15:38:52 首次发布