Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kovacshuni
Created September 21, 2017 16:10
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 kovacshuni/8bdf66b9005a1992063d7cc95409270a to your computer and use it in GitHub Desktop.
Save kovacshuni/8bdf66b9005a1992063d7cc95409270a to your computer and use it in GitHub Desktop.
test-server
package main
import (
"fmt"
"log"
"net/http"
"net/http/httputil"
"github.com/gorilla/mux"
)
func main() {
router := mux.NewRouter()
router.HandleFunc("/content-query", Index)
log.Fatal(http.ListenAndServe(":8083", router))
}
func Index(w http.ResponseWriter, r *http.Request) {
dump, err := httputil.DumpRequest(r, true)
if err != nil {
log.Fatal(err)
}
log.Printf("%s", dump)
fmt.Fprintf(w, "Hello, %v", string(dump))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment