From 3ac410c3dfe0131766c5b041e6500946c871c218 Mon Sep 17 00:00:00 2001 From: Finn Herzfeld Date: Wed, 5 Dec 2018 13:49:32 -0800 Subject: [PATCH] Properly log the request body --- testhelper.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testhelper.go b/testhelper.go index a446ff9..412610d 100644 --- a/testhelper.go +++ b/testhelper.go @@ -2,7 +2,7 @@ package main; import ( "net/http" - // "golang.org/x/net/html" + "io/ioutil" "database/sql" _ "github.com/lib/pq" "os" @@ -29,7 +29,10 @@ func main() { }) http.HandleFunc("/v1/directory/reconcile", func(w http.ResponseWriter, r *http.Request) { - log.Printf("%s", r.Body) + b, err := ioutil.ReadAll(r.Body) + defer r.Body.Close() + crash(err) + log.Printf("%s", b) }) log.Fatal(http.ListenAndServe(":8082", nil)) }