(path string)
| 375 | } |
| 376 | |
| 377 | func (c *Client) GetJSON(path string) (*Response, error) { |
| 378 | c.log.Debug("testcli: get json request %q", path) |
| 379 | req, err := c.GetRequest(path) |
| 380 | if err != nil { |
| 381 | return nil, err |
| 382 | } |
| 383 | req.Header.Set("Accept", "application/json") |
| 384 | return c.Do(req) |
| 385 | } |
| 386 | |
| 387 | func (c *Client) GetRequest(path string) (*http.Request, error) { |
| 388 | return http.NewRequest(http.MethodGet, getURL(path), nil) |