(ctx context.Context, endpoint string)
| 37 | } |
| 38 | |
| 39 | func (client *httpClient) GET(ctx context.Context, endpoint string) (*http.Response, error) { |
| 40 | if client.baseURL == nil { |
| 41 | return nil, ErrNoBaseURL |
| 42 | } |
| 43 | url := client.baseURL.JoinPath(endpoint) |
| 44 | |
| 45 | req, err := http.NewRequestWithContext(ctx, http.MethodGet, url.String(), nil) |
| 46 | if err != nil { |
| 47 | return nil, fmt.Errorf("error creating GET request: %w", err) |
| 48 | } |
| 49 | |
| 50 | req.Header.Add("Accept", "application/json;version=1") |
| 51 | |
| 52 | response, err := client.Do(req) |
| 53 | if err != nil { |
| 54 | return nil, fmt.Errorf("error GET request: %w", err) |
| 55 | } |
| 56 | |
| 57 | return response, nil |
| 58 | } |
| 59 | |
| 60 | type LogConfiguration struct { |
| 61 | logFile string |
no test coverage detected