1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 23:30:50 +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
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