mirror of
https://github.com/astaxie/beego.git
synced 2024-11-05 02:10:55 +00:00
fix the dump has no body
This commit is contained in:
parent
44a39a6b3e
commit
44c8534477
@ -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))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user