Properly log the request body
This commit is contained in:
parent
dd7771d535
commit
3ac410c3df
1 changed files with 5 additions and 2 deletions
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue