Commit 68ccd8e5 authored by astaxie's avatar astaxie

fix the dump has no body

parent 6f802b0a
...@@ -135,6 +135,7 @@ type BeegoHttpRequest struct { ...@@ -135,6 +135,7 @@ type BeegoHttpRequest struct {
setting BeegoHttpSettings setting BeegoHttpSettings
resp *http.Response resp *http.Response
body []byte body []byte
dump []byte
} }
// Change request settings // Change request settings
...@@ -168,8 +169,8 @@ func (b *BeegoHttpRequest) Debug(isdebug bool) *BeegoHttpRequest { ...@@ -168,8 +169,8 @@ func (b *BeegoHttpRequest) Debug(isdebug bool) *BeegoHttpRequest {
} }
// return the DumpRequest // return the DumpRequest
func (b *BeegoHttpRequest) DumpRequest() (dump []byte, err error) { func (b *BeegoHttpRequest) DumpRequest() []byte {
return httputil.DumpRequest(b.req, true) return b.dump
} }
// SetTimeout sets connect time out and read-write time out for BeegoRequest. // SetTimeout sets connect time out and read-write time out for BeegoRequest.
...@@ -405,6 +406,7 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) { ...@@ -405,6 +406,7 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) {
if err != nil { if err != nil {
println(err.Error()) println(err.Error())
} }
b.dump = dump
println(string(dump)) println(string(dump))
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment