Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Url query to parameter map
private Map<String, String> queryToMap(String query) throws UnsupportedEncodingException {
Map<String, String> parameters = new HashMap<>();
String[] queryArray = query.split("&");
for (String string : queryArray) {
int idx = string.indexOf("=");
parameters.put(decode(string.substring(0, idx), "UTF-8"), decode(string.substring(idx + 1), "UTF-8"));
return parameters;

This comment has been minimized.

Copy link
Owner Author

@LenarBad LenarBad commented Apr 8, 2019

More on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment