Created
September 21, 2017 16:10
-
-
Save kovacshuni/8bdf66b9005a1992063d7cc95409270a to your computer and use it in GitHub Desktop.
test-server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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