(path string, body io.Reader)
| 81 | } |
| 82 | |
| 83 | func (c *Client) patch(path string, body io.Reader) ([]byte, error) { |
| 84 | data, code, err := c.doRequest("PATCH", path, body) |
| 85 | if err != nil { |
| 86 | return nil, err |
| 87 | } |
| 88 | if code >= 400 { |
| 89 | return nil, fmt.Errorf("HTTP %d: %s", code, strings.TrimSpace(string(data))) |
| 90 | } |
| 91 | return data, nil |
| 92 | } |
| 93 | |
| 94 | // getJSON fetches a path and unmarshals JSON into a generic map. |
| 95 | func (c *Client) getJSON(path string) (map[string]any, error) { |
no test coverage detected