MCPcopy Index your code
hub / github.com/syncthing/syncthing / RequestJSON

Method RequestJSON

cmd/syncthing/cli/client.go:137–143  ·  view source on GitHub ↗
(url, method string, o interface{})

Source from the content-addressed store, hash-verified

135}
136
137func (c *apiClient) RequestJSON(url, method string, o interface{}) (*http.Response, error) {
138 data, err := json.Marshal(o)
139 if err != nil {
140 return nil, err
141 }
142 return c.Request(url, method, bytes.NewBuffer(data))
143}
144
145func (c *apiClient) Get(url string) (*http.Response, error) {
146 return c.RequestString(url, "GET", "")

Callers 1

PutJSONMethod · 0.95

Calls 2

RequestMethod · 0.95
MarshalMethod · 0.80

Tested by

no test coverage detected