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 (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
// "golang.org/x/net/html"
|
"io/ioutil"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
"os"
|
"os"
|
||||||
|
@ -29,7 +29,10 @@ func main() {
|
||||||
})
|
})
|
||||||
|
|
||||||
http.HandleFunc("/v1/directory/reconcile", func(w http.ResponseWriter, r *http.Request) {
|
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))
|
log.Fatal(http.ListenAndServe(":8082", nil))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue