Last active
December 18, 2020 03:14
-
-
Save MgenGlder/19a1bfff485e95c06d6abb829a519d5d to your computer and use it in GitHub Desktop.
Convert map to http params
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
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