code: public static String map2URLEncoded(Map params){
          StringBuilder stringBuilder = new StringBuilder();
          try{
              Set keySet = params.keySet();
              Object[] keys = keySet.toArray();
              for (int i = 0; i < keys.length; i++) {
                  stringBuilder.append(encode(keys[i].toString(), "UTF-8")).append("=").append(encode(params.get(keys[i]).toString(), "UTF-8"));
                  if(i < (keys.length - 1)){
                      stringBuilder.append("&");
                  }
              }
          }catch(Exception e){
              throw new HttpException("failed to generate content from map", e);
          }
          return stringBuilder.toString();
      }
docs: Converts a map to URL- encoded string. This is a convenience method which can be used in combination
  with {@link #post(String, byte[])}, {@link #put(String, String)} and others. It makes it easy
  to convert parameters to submit a string:
  
  <pre>
  key=value&key1=value1;
  </pre>
  
  @param params map with keys and values to be posted. This map is used to build
  a URL-encoded string, such that keys are names of parameters, and values are values of those
  parameters. This method will also URL-encode keys and content using UTF-8 encoding.
  <p>
  String representations of both keys and values are used.
  </p>
  @return URL-encided string like: <code>key=value&key1=value1;</code>