Last active
July 6, 2017 20:56
-
-
Save bobuva/83e67a7d0db1b885e4403a32f4054c17 to your computer and use it in GitHub Desktop.
Print out HTTP Request for debugging purposes
This file contains 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
// Reference: https://golang.org/pkg/net/http/httputil/#DumpRequest | |
import ( | |
"net/http/httputil" | |
) | |
// Print this request for debugging. | |
// request: the http.Request object. | |
requestDump, err := httputil.DumpRequest(request, true) | |
if err != nil { | |
fmt.Println(err) | |
} | |
fmt.Println(string(requestDump)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment