Created
September 28, 2017 23:30
-
-
Save alextanhongpin/ec4019788f3f667292b6aafb13aed677 to your computer and use it in GitHub Desktop.
Simple script to dump http request
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
import "net/http/httputil" | |
func main() { | |
dump := func(r *http.Request) { | |
output, err := httputil.DumpRequest(r, true) | |
if err != nil { | |
fmt.Println("Error dumping request:", err) | |
return | |
} | |
fmt.Println(string(output)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment