MCPcopy Create free account
hub / github.com/gavv/httpexpect / Response

Method Response

printer.go:120–134  ·  view source on GitHub ↗

Response implements Printer.Response.

(resp *http.Response, duration time.Duration)

Source from the content-addressed store, hash-verified

118
119// Response implements Printer.Response.
120func (p DebugPrinter) Response(resp *http.Response, duration time.Duration) {
121 if resp == nil {
122 return
123 }
124
125 dump, err := httputil.DumpResponse(resp, p.body)
126 if err != nil {
127 panic(err)
128 }
129
130 text := strings.Replace(string(dump), "\r\n", "\n", -1)
131 lines := strings.SplitN(text, "\n", 2)
132
133 p.logger.Logf("%s %s\n%s", lines[0], duration, lines[1])
134}
135
136// WebsocketWrite implements WebsocketPrinter.WebsocketWrite.
137func (p DebugPrinter) WebsocketWrite(typ int, content []byte, closeCode int) {

Callers 2

TestPrinter_DebugFunction · 0.95
TestPrinter_PanicsFunction · 0.95

Calls 1

LogfMethod · 0.65

Tested by 2

TestPrinter_DebugFunction · 0.76
TestPrinter_PanicsFunction · 0.76