Skip to content

Instantly share code, notes, and snippets.

@matiangul
Created July 4, 2017 11:34
Show Gist options
  • Save matiangul/b84a2d343d549fe7e7c604351216869e to your computer and use it in GitHub Desktop.
Save matiangul/b84a2d343d549fe7e7c604351216869e to your computer and use it in GitHub Desktop.
kotlin http query params
fun getQuery() = mapOf("page" to page)
.filterValues { it != null }
.map { "${it.key}=${it.value}" }
.joinToString(separator = "&", prefix = "?")
.removeSuffix("?")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment