private String createURL(String url, Map<String, List<String>> params) throws UnsupportedEncodingException { if (params == null || params.isEmpty()) { return url; } StringBuilder sb = new StringBuilder(url); if (!params.isEmpty()) sb.append("?").append(createPostParameters(params, null).replace("+", "%20")); return sb.toString(); }
private String createURL(String url, Map<String, List<String>> params) throws UnsupportedEncodingException { if (params == null || params.isEmpty()) { return url; } StringBuilder sb = new StringBuilder(url); if (!params.isEmpty()) sb.append("?").append(createPostParameters(params, null).replace("+", "%20")); return sb.toString(); }
if (data == null) { c.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); data = createPostParameters(params, charsetForEncoding).getBytes(charsetForEncoding);
if (data == null) { c.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); data = createPostParameters(params, charsetForEncoding).getBytes(charsetForEncoding);