MCPcopy Create free account
hub / github.com/imroc/req / SetDumpOptions

Method SetDumpOptions

request.go:1066–1079  ·  view source on GitHub ↗

SetDumpOptions sets DumpOptions at request level.

(opt *DumpOptions)

Source from the content-addressed store, hash-verified

1064
1065// SetDumpOptions sets DumpOptions at request level.
1066func (r *Request) SetDumpOptions(opt *DumpOptions) *Request {
1067 if opt == nil {
1068 return r
1069 }
1070 if opt.Output == nil {
1071 opt.Output = r.getDumpBuffer()
1072 }
1073 if r.dumpOptions != nil {
1074 *r.dumpOptions = *opt
1075 } else {
1076 r.dumpOptions = opt
1077 }
1078 return r
1079}
1080
1081// EnableDump enables dump, including all content for the request and response by default.
1082func (r *Request) EnableDump() *Request {

Callers 2

SetDumpOptionsFunction · 0.80
TestEnableDumpFunction · 0.80

Calls 1

getDumpBufferMethod · 0.95

Tested by 1

TestEnableDumpFunction · 0.64