MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / getJSON

Method getJSON

internal/tui/client.go:95–105  ·  view source on GitHub ↗

getJSON fetches a path and unmarshals JSON into a generic map.

(path string)

Source from the content-addressed store, hash-verified

93
94// getJSON fetches a path and unmarshals JSON into a generic map.
95func (c *Client) getJSON(path string) (map[string]any, error) {
96 data, err := c.get(path)
97 if err != nil {
98 return nil, err
99 }
100 var result map[string]any
101 if err := json.Unmarshal(data, &result); err != nil {
102 return nil, err
103 }
104 return result, nil
105}
106
107// postJSON sends a JSON body via POST and checks for errors.
108func (c *Client) postJSON(path string, body any) error {

Callers 8

GetConfigMethod · 0.95
GetAuthFilesMethod · 0.95
GetLogsMethod · 0.95
GetAPIKeysMethod · 0.95
getWrappedKeyListMethod · 0.95
GetDebugMethod · 0.95
GetAuthStatusMethod · 0.95
startOAuthMethod · 0.80

Calls 1

getMethod · 0.95

Tested by

no test coverage detected