Skip to content

Instantly share code, notes, and snippets.

@maxcnunes
Created June 6, 2019 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxcnunes/fe48a821c7d56c2dc6278ce4a5ae338f to your computer and use it in GitHub Desktop.
Save maxcnunes/fe48a821c7d56c2dc6278ce4a5ae338f to your computer and use it in GitHub Desktop.
Dump http request in Go
// Save a copy of this request for debugging.
requestDump, err := httputil.DumpRequest(r, true)
if err != nil {
fmt.Println("--->DEBUG ERROR", r.URL, err)
}
fmt.Println("--->DEBUG BODY", r.URL, string(requestDump))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment