MCPcopy Create free account
hub / github.com/mmcgrana/gobyexample / headers

Function headers

examples/http-server/http-server.go:25–35  ·  view source on GitHub ↗
(w http.ResponseWriter, req *http.Request)

Source from the content-addressed store, hash-verified

23}
24
25func headers(w http.ResponseWriter, req *http.Request) {
26
27 // This handler does something a little more
28 // sophisticated by reading all the HTTP request
29 // headers and echoing them into the response body.
30 for name, headers := range req.Header {
31 for _, h := range headers {
32 fmt.Fprintf(w, "%v: %v\n", name, h)
33 }
34 }
35}
36
37func main() {
38

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected