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

Method SetOutput

request.go:561–569  ·  view source on GitHub ↗

SetOutput set the io.Writer that response Body will be downloaded to.

(output io.Writer)

Source from the content-addressed store, hash-verified

559
560// SetOutput set the io.Writer that response Body will be downloaded to.
561func (r *Request) SetOutput(output io.Writer) *Request {
562 if output == nil {
563 r.client.log.Warnf("nil io.Writer is not allowed in SetOutput")
564 return r
565 }
566 r.output = output
567 r.isSaveResponse = true
568 return r
569}
570
571// SetQueryParams set URL query parameters from a map for the request.
572func (r *Request) SetQueryParams(params map[string]string) *Request {

Callers 4

TestLoggerFunction · 0.45
SetOutputFunction · 0.45
TestDownloadCallbackFunction · 0.45

Calls 1

WarnfMethod · 0.65

Tested by 3

TestLoggerFunction · 0.36
TestDownloadCallbackFunction · 0.36