Java tutorial
//package com.java2s; import java.util.Iterator; import java.util.Map; public class Main { public static String getReqPama(Map<String, String> params) { StringBuffer sBuffer = new StringBuffer(); Iterator<?> iterator = params.keySet().iterator(); while (iterator.hasNext()) { String key = (String) iterator.next(); sBuffer.append(key + "=" + params.get(key) + "&"); } String reqString = sBuffer.toString(); return reqString.substring(0, reqString.length() - 1); } }