MCPcopy Create free account
hub / github.com/docker/docker-agent / getBody

Method getBody

pkg/toolinstall/registry.go:361–369  ·  view source on GitHub ↗

getBody performs a GET request and returns the full response body.

(ctx context.Context, url string)

Source from the content-addressed store, hash-verified

359
360// getBody performs a GET request and returns the full response body.
361func (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.
372func (r *Registry) getJSON(ctx context.Context, url string, target any) error {

Callers 2

LookupByNameMethod · 0.95
fetchIndexMethod · 0.95

Calls 2

doGetMethod · 0.95
CloseMethod · 0.65

Tested by

no test coverage detected