获取form数据

@param useUrlencode 是否使用URLEncode对value进行编码，true表示使用URLEncode进行编码
@param charset      编码字符集
@return form数据
177369
public String data(boolean useUrlencode, String charset) {
        StringBuilder sb = new StringBuilder();
        if (useUrlencode) {
            datas.forEach((k, v) -> sb.append("&").append(k).append("=")
                .append(urlencode(String.valueOf(v), charset)));
        } else {
            datas.forEach((k, v) -> sb.append("&").append(k).append("=").append(String.valueOf(v)));
        }
        return sb.toString().substring(1);
    }
864494
public static String urlEncode(String str)
    {
        String ret = str;

        try 
        {
            ret = URLEncoder.encode(str, "UTF-8");
        } 
        catch (UnsupportedEncodingException e) 
        {
            logger.severe("Failed to encode value: "+str);
        }

        return ret;
    }
36988
public static String urlEncode(String s) {
        try {
            return URLEncoder.encode(s, StandardCharsets.UTF_8.name());
        } catch (UnsupportedEncodingException e) {
            throw new IllegalStateException("get a jdk that actually supports utf-8", e);
        }
    }
863324
public Object parse(URL url, String charset) {
        return parseURL(url, null, charset);
    }
330180
public static String encode(String url, Charset charset) {
		if (StrUtil.isEmpty(url)) {
			return url;
		}
		if (null == charset) {
			charset = CharsetUtil.defaultCharset();
		}
		return URLEncoder.DEFAULT.encode(url, charset);
	}
147879
public boolean init(URL groupedSetUrl, Charset charset) {
		if (groupedSetUrl == null) {
			throw new RuntimeException("Null GroupSet url or charset define!");
		}
		this.charset = charset;
		this.groupedSetUrl = groupedSetUrl;

		return this.load(groupedSetUrl);
	}
1263192
private String urlEncode(Object value)
	{
		try {
			return URLEncoder.encode(value.toString(), UTF8.name());
		} catch (UnsupportedEncodingException e) { throw new RuntimeException(e); }
	}
839633
public static String encodeUrl(String stringToEncode) {
        try {
            return URLEncoder.encode(stringToEncode, "UTF-8");
        } catch (UnsupportedEncodingException e1) {
            throw new RuntimeException(e1);
        }
    }
863003
public static final String encode(String str, Charset charset)
    {
        return encode(str, charset.name());
    }
1028747
private static String decodeFormFields (final String content, final String charset) {
        if (content == null) {
            return null;
        }
        return urldecode(content, charset != null ? Charset.forName(charset) : Consts.UTF_8, true);
    }
1198690
public static String encode(String value, Charset charset) {
		try {
			return URLEncoder.encode(value, charset.name());
		}
		catch (UnsupportedEncodingException ex) {
			throw new IllegalArgumentException("Characterset is not supported.");
		}
	}
853654
public final static String getHeader(String headerKey, String charset) {
		return ServletUtil.getHeader(getServletRequest(), headerKey, charset);
	}
377005
public String toUrlEncodedString() {
        QueryStringEncoder encoder = new QueryStringEncoder("");
        for (Map.Entry<String, String> entry : formValues.entrySet()) {
            encoder.addParam(entry.getKey(), entry.getValue());
        }
        StringBuilder ues = new StringBuilder(encoder.toString());
        if (ues.length() > 0 && ues.charAt(0) == '?') {
            ues.deleteCharAt(0);
        }
        return ues.toString();
    }
531169
private String encode(String str) {
        if (str == null) {
            return null;
        }
        try {
            return URLEncoder.encode(str, Charsets.UTF_8.name());
        } catch (UnsupportedEncodingException e) {
            // Should never happen
            throw Throwables.propagate(e);
        }
    }
1320794
public static String getResponseAsString(String uri, String charsetName) {
        return request(new HttpGet(uri), charsetName);
    }
1367562
public static String urlEncode(String s) {
		if (s == null) {
			return "";
		}
		String encoded = s;
		try {
			encoded = URLEncoder.encode(s, Config.DEFAULT_ENCODING);
		} catch (UnsupportedEncodingException ex) {
			logger.error(null, ex);
		}
		return encoded;
	}
432426
public static String urlEncode(String string) {
        try {
            return URLEncoder.encode(string, CHARSET);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }