Here you can find the source of convertToParameterString(Map
public static String convertToParameterString(Map<String, Object> parameterMap)
//package com.java2s; //License from project: Open Source License import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.Map; import java.util.Map.Entry; public class Main { public static String convertToParameterString(Map<String, Object> parameterMap) { StringBuilder returnValue = new StringBuilder(); if (parameterMap != null) { try { for (Entry<String, Object> entry : parameterMap.entrySet()) { if (returnValue.length() > 0) returnValue.append("&"); returnValue.append(URLEncoder.encode(entry.getKey(), "UTF-8")); returnValue.append("="); if (entry.getValue() != null) returnValue.append(URLEncoder.encode(entry.getValue().toString(), "UTF-8")); }//from w w w.ja va2 s . c om } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } return returnValue.toString(); } }