NewControllerHTTPClient returns new ControllerHTTPClient
(address string, timeoutSec time.Duration, headers http.Header)
| 57 | |
| 58 | // NewControllerHTTPClient returns new ControllerHTTPClient |
| 59 | func NewControllerHTTPClient(address string, timeoutSec time.Duration, headers http.Header) *ControllerHTTPClient { |
| 60 | return &ControllerHTTPClient{ |
| 61 | c: &http.Client{ |
| 62 | Timeout: timeoutSec, |
| 63 | }, |
| 64 | address: address, |
| 65 | headers: headers, |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | // buildRequest builds an http.Request with headers. |
| 70 | func (c *ControllerHTTPClient) buildRequest(method, path string, body io.Reader) (req *http.Request, err error) { |