(path string)
| 59 | } |
| 60 | |
| 61 | func (c *Client) get(path string) ([]byte, error) { |
| 62 | data, code, err := c.doRequest("GET", path, nil) |
| 63 | if err != nil { |
| 64 | return nil, err |
| 65 | } |
| 66 | if code >= 400 { |
| 67 | return nil, fmt.Errorf("HTTP %d: %s", code, strings.TrimSpace(string(data))) |
| 68 | } |
| 69 | return data, nil |
| 70 | } |
| 71 | |
| 72 | func (c *Client) put(path string, body io.Reader) ([]byte, error) { |
| 73 | data, code, err := c.doRequest("PUT", path, body) |
no test coverage detected