private String encodeParameters(Map<String,String> params,String paramsEncoding){
  StringBuilder encodedParams=new StringBuilder();
  try {
    for (    Map.Entry<String,String> entry : params.entrySet()) {
      encodedParams.append(URLEncoder.encode(entry.getKey(),paramsEncoding));
      encodedParams.append('=');
      encodedParams.append(URLEncoder.encode(entry.getValue(),paramsEncoding));
      encodedParams.append('&');
    }
    return encodedParams.toString();
  }
 catch (  UnsupportedEncodingException uee) {
    throw new RuntimeException("Encoding not supported: " + paramsEncoding,uee);
  }
}

private String encodeParameters ( Map < String , String > params , String paramsEncoding ) { StringBuilder encodedParams = new StringBuilder ( ) ; try { for ( Map . Entry < String , String > entry : params . entrySet ( ) ) { encodedParams . append ( URLEncoder . encode ( entry . getKey ( ) , paramsEncoding ) ) ; encodedParams . append ( '=' ) ; encodedParams . append ( URLEncoder . encode ( entry . getValue ( ) , paramsEncoding ) ) ; encodedParams . append ( '&' ) ; } return encodedParams . toString ( ) ; } catch ( UnsupportedEncodingException uee ) { throw new RuntimeException ( "Encoding not supported: " + paramsEncoding , uee ) ; } }
converts params into an application / x - www - form - urlencoded encoded string .
