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)
| 987 | // Timeout: 10 * time.Second, |
| 988 | // }).Get("https://example.com").Stdout() |
| 989 | func (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. |
no outgoing calls