code: public static String renderQueryString(Map<String, String> q, String enc) {
  		StringBuilder sb = new StringBuilder();
  		for (Map.Entry<String, String> e : q.entrySet()) {
  			String name = urlEncode(e.getKey(), enc);
  			sb.append(name);
  			if (e.getValue() != null) {
  				sb.append('=');
  				sb.append(urlEncode(e.getValue(), enc));
  			}
  			sb.append('&');
  		}
  		if (sb.length() > 0)
  			sb.setLength(sb.length() - 1);
  		return sb.toString();
  	}
docs: Method which creates string with parameters and its value in format URL
  
  @param q   map in which keys if name of parameters, value - value of parameters.
  @param enc encoding of this string
  @return string with parameters and its value in format URL