Created
July 4, 2017 11:34
-
-
Save matiangul/b84a2d343d549fe7e7c604351216869e to your computer and use it in GitHub Desktop.
kotlin http query params
This file contains hidden or 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
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