MCPcopy
hub / github.com/syncthing/syncthing / Do

Method Do

cmd/syncthing/cli/client.go:116–123  ·  view source on GitHub ↗
(req *http.Request)

Source from the content-addressed store, hash-verified

114}
115
116func (c *apiClient) Do(req *http.Request) (*http.Response, error) {
117 req.Header.Set("X-Api-Key", c.apikey)
118 resp, err := c.Client.Do(req)
119 if err != nil {
120 return nil, err
121 }
122 return resp, checkResponse(resp)
123}
124
125func (c *apiClient) Request(url, method string, r io.Reader) (*http.Response, error) {
126 request, err := http.NewRequest(method, c.Endpoint()+"rest/"+url, r)

Callers 15

RequestMethod · 0.95
getLicenseTextFunction · 0.80
reqFunction · 0.80
generatedNotesFunction · 0.80
reqFunction · 0.80
ServeMethod · 0.80
CloseMethod · 0.80
internalCloseMethod · 0.80
sendUsageReportMethod · 0.80
sendFailureReportsFunction · 0.80
DialContextMethod · 0.80
CloseMethod · 0.80

Calls 2

checkResponseFunction · 0.85
SetMethod · 0.45

Tested by 14

newFakeConnectionFunction · 0.64
testHTTPRequestFunction · 0.64
httpRequestFunction · 0.64
TestCSRFRequiredFunction · 0.64
TestRandomStringFunction · 0.64
testConfigPostFunction · 0.64
TestHostCheckFunction · 0.64
TestOptionsRequestFunction · 0.64
TestConfigChangesFunction · 0.64
TestHTTPGetIndexAuthFunction · 0.64
TestHTTPOptionsFunction · 0.64