Skip to content

Instantly share code, notes, and snippets.

@MgenGlder
Last active December 18, 2020 03:14
Show Gist options
  • Save MgenGlder/19a1bfff485e95c06d6abb829a519d5d to your computer and use it in GitHub Desktop.
Save MgenGlder/19a1bfff485e95c06d6abb829a519d5d to your computer and use it in GitHub Desktop.
Convert map to http params
mapToHttpParams(params)
function mapToHttpParams (m : Map) : String {
let s = "";
if (!empty(m)) {
for(let key in m) {
let value = m[key];
if (!empty(value)) {
s = StringUtils.format("{0}{1}{2}={3}",
s,
(s.length != 0) ? "&":"",
key,
value );
}
}
}
return s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment