diff --git a/pkg/conch/sling.go b/pkg/conch/sling.go index dc5b4b8..d643d83 100644 --- a/pkg/conch/sling.go +++ b/pkg/conch/sling.go @@ -107,25 +107,21 @@ func (c *Conch) get(url string, data interface{}) error { func (c *Conch) httpDo(req *http.Request, data interface{}) (*http.Response, error) { - if c.Trace { - c.ddp(req) - } else { - c.debugLog(fmt.Sprintf( - "Request: %s %s", - req.Method, - req.URL, - )) - - if (req.Method == "POST") && (req.Body != nil) { - if read, err := req.GetBody(); err == nil { - if bodyBytes, err := ioutil.ReadAll(read); err == nil { - c.debugLog( - fmt.Sprintf( - " Request Body: %s", - string(bodyBytes), - ), - ) - } + c.debugLog(fmt.Sprintf( + "Request: %s %s", + req.Method, + req.URL, + )) + + if (req.Method == "POST") && (req.Body != nil) { + if read, err := req.GetBody(); err == nil { + if bodyBytes, err := ioutil.ReadAll(read); err == nil { + c.debugLog( + fmt.Sprintf( + " Request Body: %s", + string(bodyBytes), + ), + ) } } } @@ -135,10 +131,6 @@ func (c *Conch) httpDo(req *http.Request, data interface{}) (*http.Response, err return res, err } - if c.Trace { - c.ddp(res) - } - defer res.Body.Close() bodyBytes, err := ioutil.ReadAll(res.Body)