From 68ccd8e5a4ea96cb3852c75d69120a61b613eda6 Mon Sep 17 00:00:00 2001 From: astaxie Date: Thu, 9 Apr 2015 00:11:25 +0800 Subject: [PATCH] fix the dump has no body --- httplib/httplib.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/httplib/httplib.go b/httplib/httplib.go index 57d3de61..f09c8509 100644 --- a/httplib/httplib.go +++ b/httplib/httplib.go @@ -135,6 +135,7 @@ type BeegoHttpRequest struct { setting BeegoHttpSettings resp *http.Response body []byte + dump []byte } // Change request settings @@ -168,8 +169,8 @@ func (b *BeegoHttpRequest) Debug(isdebug bool) *BeegoHttpRequest { } // return the DumpRequest -func (b *BeegoHttpRequest) DumpRequest() (dump []byte, err error) { - return httputil.DumpRequest(b.req, true) +func (b *BeegoHttpRequest) DumpRequest() []byte { + return b.dump } // SetTimeout sets connect time out and read-write time out for BeegoRequest. @@ -405,6 +406,7 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) { if err != nil { println(err.Error()) } + b.dump = dump println(string(dump)) }