getBody performs a GET request and returns the full response body.
(ctx context.Context, url string)
| 359 | |
| 360 | // getBody performs a GET request and returns the full response body. |
| 361 | func (r *Registry) getBody(ctx context.Context, url string) ([]byte, error) { |
| 362 | resp, err := r.doGet(ctx, url, nil) |
| 363 | if err != nil { |
| 364 | return nil, err |
| 365 | } |
| 366 | defer resp.Body.Close() |
| 367 | |
| 368 | return io.ReadAll(resp.Body) |
| 369 | } |
| 370 | |
| 371 | // getJSON performs a GET request and decodes the JSON response into target. |
| 372 | func (r *Registry) getJSON(ctx context.Context, url string, target any) error { |
no test coverage detected