public static String buildMap(Map<String, String> map) {
if (map == null) {
return "";
}
StringBuffer sb = new StringBuffer();
if (map.size() > 0) {
for (String key : map.keySet()) {
sb.append(key + "=");
if (StringUtils.isEmpty(map.get(key))) {
sb.append("&");
} else {
Object object = map.get(key);
String value = object.toString();
System.out.println(value);
sb.append(value + "&");
}
}
}
return sb.toString();
}
Map组装成url请求参数
最新推荐文章于 2022-10-18 16:51:55 发布