code: public static String buildQuery(Map<String, String> entries, String encoding) throws FoxHttpRequestException {
          if (entries.size() > 0) {
              StringBuilder sb = new StringBuilder();
              String dataString;
              try {
                  for (Map.Entry<String, String> entry : entries.entrySet()) {
                      sb.append(URLEncoder.encode(entry.getKey(), encoding));
                      sb.append("=");
                      sb.append(URLEncoder.encode(entry.getValue(), encoding));
                      sb.append("&");
                  }
                  sb.deleteCharAt(sb.lastIndexOf("&"));
                  dataString = sb.toString();
              } catch (UnsupportedEncodingException e) {
                  throw new FoxHttpRequestException(e);
              }
              return dataString;
          } else {
              return "";
          }
      }
docs: Return a string of key/value pair's based on a map
  
  @param entries
  @param encoding
  @return
  @throws FoxHttpRequestException