public static String xwwwformEncode(Map map) {
        /*
        The following code is based on apache http client, which we have removed it from xian-core dependencies.

        String applicationXwwwformUrlEncodedString;
        if (paramsMap != null) {
            List<NameValuePair> paramList = new ArrayList<>();
            for (Object key : paramsMap.keySet()) {
                if (key != null && paramsMap.get(key) != null) {
                    NameValuePair pair = new BasicNameValuePair(key.toString(), paramsMap.get(key).toString());
                    paramList.add(pair);
                }
            }
            applicationXwwwformUrlEncodedString = URLEncodedUtils.format(paramList, ENCODING);
        } else {
            applicationXwwwformUrlEncodedString = "";
            LOG.warn("post请求的body参数为空，请确认");
        }
        return applicationXwwwformUrlEncodedString;
        */
        StringBuilder stringBuilder = new StringBuilder();
        if (map == null) {
            return stringBuilder.toString();
        } else {
            for (Object entryObject : map.entrySet()) {
                Map.Entry entry = (Map.Entry) entryObject;
                stringBuilder.append(entry.getKey())
                        .append("=")
                        .append(entry.getValue())
                        .append("&");
            }
            return stringBuilder.substring(0, stringBuilder.length() - 1);
        }
    }
public static String xwwwformEncode ( Map map ) { StringBuilder stringBuilder = new StringBuilder ( ) ; if ( map == null ) { return stringBuilder . toString ( ) ; } else { for ( Object entryObject : map . entrySet ( ) ) { Map . Entry entry = ( Map . Entry ) entryObject ; stringBuilder . append ( entry . getKey ( ) ) . append ( "=" ) . append ( entry . getValue ( ) ) . append ( "&" ) ; } return stringBuilder . substring ( 0 , stringBuilder . length ( ) - 1 ) ; } }
@param map the parameter map
@return the x-www-form-urlencoded string