MCPcopy
hub / github.com/livebud/bud / GetJSON

Method GetJSON

internal/testcli/testcli.go:377–385  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

375}
376
377func (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
387func (c *Client) GetRequest(path string) (*http.Request, error) {
388 return http.NewRequest(http.MethodGet, getURL(path), nil)

Callers 15

TestIndexStringFunction · 0.80
TestNoContentFunction · 0.80
TestJSONMultipleActionsFunction · 0.80
TestNestedResourceFunction · 0.80
TestDeepNestedResourceFunction · 0.80
TestViewUnnamedFunction · 0.80
TestViewNestedUnnamedFunction · 0.80
TestViewDeepUnnamedFunction · 0.80
TestResourceContextFunction · 0.80
TestHandlerFuncsFunction · 0.80
TestControllerChangeFunction · 0.80
TestRequestMapFunction · 0.80

Implementers 2

discardpackage/budhttp/discard.go
clientpackage/budhttp/client.go

Calls 4

GetRequestMethod · 0.95
DoMethod · 0.95
DebugMethod · 0.65
SetMethod · 0.65

Tested by 15

TestIndexStringFunction · 0.64
TestNoContentFunction · 0.64
TestJSONMultipleActionsFunction · 0.64
TestNestedResourceFunction · 0.64
TestDeepNestedResourceFunction · 0.64
TestViewUnnamedFunction · 0.64
TestViewNestedUnnamedFunction · 0.64
TestViewDeepUnnamedFunction · 0.64
TestResourceContextFunction · 0.64
TestHandlerFuncsFunction · 0.64
TestControllerChangeFunction · 0.64
TestRequestMapFunction · 0.64