MCPcopy
hub / github.com/bitfield/script / WithHTTPClient

Method WithHTTPClient

script.go:989–992  ·  view source on GitHub ↗

WithHTTPClient sets the HTTP client c for use with subsequent requests via [Pipe.Do], [Pipe.Get], or [Pipe.Post]. For example, to make a request using a client with a timeout: NewPipe().WithHTTPClient(&http.Client{ Timeout: 10 * time.Second, }).Get("https://example.com").Stdout()

(c *http.Client)

Source from the content-addressed store, hash-verified

987// Timeout: 10 * time.Second,
988// }).Get("https://example.com").Stdout()
989func (p *Pipe) WithHTTPClient(c *http.Client) *Pipe {
990 p.httpClient = c
991 return p
992}
993
994// WithReader sets the pipe's input reader to r. Once r has been completely
995// read, it will be closed if necessary.

Calls

no outgoing calls