List of utility methods to do URL Query Build
String | mapToQueryString(Map parameters, String charSet) map To Query String String queryString = ""; if (parameters != null && !parameters.isEmpty()) { Set<Entry> entrySet = parameters.entrySet(); for (Entry entry : entrySet) { try { String key = entry.getKey().toString(); Object value = entry.getValue(); List values = makeStringList(value); ... |
String | mapToQueryString(Map map To Query String String queryString = ""; if (parameters != null && !parameters.isEmpty()) { for (String key : parameters.keySet()) { try { Object value = parameters.get(key); if (value instanceof String) { queryString += key + "=" + URLEncoder.encode(value == null ? "" : value.toString(), charSet) + "&"; ... |
String | mapToQueryString(Map map To Query String StringBuilder sb = new StringBuilder(); for (Map.Entry<String, String> e : queryString.entrySet()) { if (sb.length() > 0) { sb.append('&'); sb.append(URLEncoder.encode(e.getKey(), ENCODING_UTF_8)).append('=') .append(URLEncoder.encode(e.getValue(), "UTF-8")); return sb.toString(); |
String | toQueryString(Map, ?> map) to Query String StringBuilder sb = new StringBuilder(); for (Map.Entry<?, ?> entry : map.entrySet()) { if (sb.length() > 0) { sb.append("&"); sb.append(String.format("%s=%s", urlEncodeUTF8(entry.getKey().toString()), urlEncodeUTF8(entry.getValue().toString()))); return sb.toString(); |
String | toQueryString(Map to Query String String paramStr = ""; for (Map.Entry<String, String> entry : requestMap.entrySet()) { if (!paramStr.isEmpty()) { paramStr += "&"; paramStr += entry.getKey() + "=" + URLEncoder.encode(entry.getValue(), "UTF-8"); return paramStr; ... |