1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 02:51:28 +00:00

fixed bug-request dump too early

This commit is contained in:
jessonchan 2014-08-22 17:12:46 +08:00
parent 7b39bd7042
commit f684de2385

View File

@ -319,13 +319,6 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) {
} }
b.req.URL = url 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 trans := b.setting.Transport
@ -370,6 +363,14 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) {
b.req.Header.Set("User-Agent", b.setting.UserAgent) 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) resp, err := client.Do(b.req)
if err != nil { if err != nil {
return nil, err return nil, err