68ccd8e5 by astaxie

fix the dump has no body

1 parent 6f802b0a
...@@ -135,6 +135,7 @@ type BeegoHttpRequest struct { ...@@ -135,6 +135,7 @@ type BeegoHttpRequest struct {
135 setting BeegoHttpSettings 135 setting BeegoHttpSettings
136 resp *http.Response 136 resp *http.Response
137 body []byte 137 body []byte
138 dump []byte
138 } 139 }
139 140
140 // Change request settings 141 // 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 {
168 } 169 }
169 170
170 // return the DumpRequest 171 // return the DumpRequest
171 func (b *BeegoHttpRequest) DumpRequest() (dump []byte, err error) { 172 func (b *BeegoHttpRequest) DumpRequest() []byte {
172 return httputil.DumpRequest(b.req, true) 173 return b.dump
173 } 174 }
174 175
175 // SetTimeout sets connect time out and read-write time out for BeegoRequest. 176 // 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) {
405 if err != nil { 406 if err != nil {
406 println(err.Error()) 407 println(err.Error())
407 } 408 }
409 b.dump = dump
408 println(string(dump)) 410 println(string(dump))
409 } 411 }
410 412
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!