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

Method EnableDumpEachRequestWithoutRequestBody

client.go:780–787  ·  view source on GitHub ↗

EnableDumpEachRequestWithoutRequestBody enable dump without request body at the request-level for each request, and only temporarily stores the dump content in memory, call Response.Dump() to get the dump content when needed.

()

Source from the content-addressed store, hash-verified

778// request-level for each request, and only temporarily stores the dump content in memory,
779// call Response.Dump() to get the dump content when needed.
780func (c *Client) EnableDumpEachRequestWithoutRequestBody() *Client {
781 return c.OnBeforeRequest(func(client *Client, req *Request) error {
782 if req.RetryAttempt == 0 { // Ignore on retry, no need to repeat enable dump.
783 req.EnableDumpWithoutRequestBody()
784 }
785 return nil
786 })
787}
788
789// NewRequest is the alias of R()
790func (c *Client) NewRequest() *Request {

Calls 2

OnBeforeRequestMethod · 0.95

Tested by

no test coverage detected