Skip to content

Instantly share code, notes, and snippets.

@ooola
Last active March 30, 2017 20:52
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 ooola/964adeb606fc9b7b472433699b685427 to your computer and use it in GitHub Desktop.
Save ooola/964adeb606fc9b7b472433699b685427 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"net/http"
"net/http/httputil"
)
func handler(w http.ResponseWriter, r *http.Request) {
requestDump, err := httputil.DumpRequest(r, true)
if err != nil {
fmt.Println(err)
}
fmt.Println(string(requestDump))
}
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":7171", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment