diff --git a/httplib/httplib.go b/httplib/httplib.go index 42615706..6531acd2 100644 --- a/httplib/httplib.go +++ b/httplib/httplib.go @@ -319,13 +319,6 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) { } b.req.URL = url - if b.setting.ShowDebug { - dump, err := httputil.DumpRequest(b.req, true) - if err != nil { - println(err.Error()) - } - println(string(dump)) - } trans := b.setting.Transport @@ -370,6 +363,14 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) { b.req.Header.Set("User-Agent", b.setting.UserAgent) } + if b.setting.ShowDebug { + dump, err := httputil.DumpRequest(b.req, true) + if err != nil { + println(err.Error()) + } + println(string(dump)) + } + resp, err := client.Do(b.req) if err != nil { return nil, err