Created
September 14, 2015 14:26
-
-
Save gvolpe/6f91d905ed94136a2198 to your computer and use it in GitHub Desktop.
Parse URL Parameters
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
import java.net.URLDecoder | |
def parseUrlParameters(url: String) = { | |
url.split("&").map( v => { | |
val m = v.split("=", 2).map(s => URLDecoder.decode(s, "UTF-8")) | |
m(0) -> m(1) | |
}).toMap | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment