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

Method EnableDumpAllToFile

client.go:612–621  ·  view source on GitHub ↗

EnableDumpAllToFile enable dump for requests fired from the client and output to the specified file.

(filename string)

Source from the content-addressed store, hash-verified

610// EnableDumpAllToFile enable dump for requests fired from the
611// client and output to the specified file.
612func (c *Client) EnableDumpAllToFile(filename string) *Client {
613 file, err := os.Create(filename)
614 if err != nil {
615 c.log.Errorf("create dump file error: %v", err)
616 return c
617 }
618 c.getDumpOptions().Output = file
619 c.EnableDumpAll()
620 return c
621}
622
623// EnableDumpAllTo enable dump for requests fired from the
624// client and output to the specified io.Writer.

Callers 2

TestEnableDumpAllToFileFunction · 0.80
EnableDumpAllToFileFunction · 0.80

Calls 3

getDumpOptionsMethod · 0.95
EnableDumpAllMethod · 0.95
ErrorfMethod · 0.65

Tested by 1

TestEnableDumpAllToFileFunction · 0.64