In the docs, start at http://golang.org/pkg/net/http and follow the "Type Request" link at http://golang.org/pkg/net/http#Request . All you need is available as a field or query method.
For example, the HTTP method is Request.Method. The path and query parameters are in the request .URL.Path and Request.URL.Query () respectively.
http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "%s %q", r.Method, html.EscapeString(r.URL.Path)) }) log.Fatal(http.ListenAndServe(":8080", nil))
source share