Here you can find the source of getQuery(Map params, String encode)
public static String getQuery(Map params, String encode)
//package com.java2s; //License from project: Open Source License import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.Iterator; import java.util.Map; public class Main { public static String getQuery(Map params, String encode) { StringBuffer query = new StringBuffer(); for (Iterator iter = params.keySet().iterator(); iter.hasNext();) { String name = (String) iter.next(); String value = (String) params.get(name); try { value = URLEncoder.encode(value, encode); } catch (UnsupportedEncodingException e) { }/* w ww. j ava2 s . c o m*/ query.append(name); query.append("="); query.append(value); query.append("&"); } return query.toString(); } }