Skip to content

Instantly share code, notes, and snippets.

View treyturner's full-sized avatar

Trey Turner treyturner

View GitHub Profile
@treyturner
treyturner / parseUri.groovy
Last active April 9, 2020 09:30
Groovy: Parse a URL while including a handy map of the query string
/**
* Created by tturner on 7/22/15.
*/
import groovy.json.*
static def parseQueryString(String string) {
string.split('&').collectEntries{ param ->
param.split('=', 2).collect{ URLDecoder.decode(it, 'UTF-8') }
}