Created
August 1, 2012 21:03
-
-
Save cmhobbs/3230713 to your computer and use it in GitHub Desktop.
Dump out the raw request of a query in Go
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
/* | |
cx is a goweb Context struct | |
cx.Request is just a net/http Request struct | |
*/ | |
raw_query := cx.Request.URL.RawQuery | |
parsed, _ := url.ParseQuery(raw_query) | |
cx.RespondWithData(parsed["payload"][0]) // grab a single field of parsed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment