Skip to content

Instantly share code, notes, and snippets.

@alextanhongpin
Created September 28, 2017 23:30
Show Gist options
  • Save alextanhongpin/ec4019788f3f667292b6aafb13aed677 to your computer and use it in GitHub Desktop.
Save alextanhongpin/ec4019788f3f667292b6aafb13aed677 to your computer and use it in GitHub Desktop.
Simple script to dump http request
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