Properly log the request body

This commit is contained in:
Finn Herzfeld 2018-12-05 13:49:32 -08:00
parent dd7771d535
commit 3ac410c3df

View file

@ -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))
}