diff --git a/comms/httpClient.go b/comms/httpClient.go new file mode 100644 index 0000000..d8ecaf4 --- /dev/null +++ b/comms/httpClient.go @@ -0,0 +1,22 @@ +package comms + +import ( + "io" + "net/http" +) + +type HttpClient struct { + Client *http.Client +} + +func NewHttpClient(client *http.Client) *HttpClient { + return &HttpClient{Client: client} +} + +func (httpClient *HttpClient) GetRequest(method string, url string, body io.Reader) (*http.Request, error) { + return http.NewRequest(method, url, body) +} + +func (httpClient *HttpClient) DoRequest(r *http.Request) (*http.Response, error) { + return httpClient.Client.Do(r) +}