Serialize map to POST data in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StringBuffer paramStr = new StringBuffer(); | |
for(String key : params.keySet()) { | |
paramStr.append(URLEncoder.encode(key)); | |
paramStr.append("="); | |
paramStr.append(URLEncoder.encode(params.get(key))); | |
paramStr.append("&"); | |
} | |
String postData = paramStr.toString(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment