Skip to content

Instantly share code, notes, and snippets.

@cmhobbs
Created August 1, 2012 21:03
Show Gist options
  • Save cmhobbs/3230713 to your computer and use it in GitHub Desktop.
Save cmhobbs/3230713 to your computer and use it in GitHub Desktop.
Dump out the raw request of a query in Go
/*
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