MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / GET

Method GET

diagnostic/client.go:39–58  ·  view source on GitHub ↗
(ctx context.Context, endpoint string)

Source from the content-addressed store, hash-verified

37}
38
39func (client *httpClient) GET(ctx context.Context, endpoint string) (*http.Response, error) {
40 if client.baseURL == nil {
41 return nil, ErrNoBaseURL
42 }
43 url := client.baseURL.JoinPath(endpoint)
44
45 req, err := http.NewRequestWithContext(ctx, http.MethodGet, url.String(), nil)
46 if err != nil {
47 return nil, fmt.Errorf("error creating GET request: %w", err)
48 }
49
50 req.Header.Add("Accept", "application/json;version=1")
51
52 response, err := client.Do(req)
53 if err != nil {
54 return nil, fmt.Errorf("error GET request: %w", err)
55 }
56
57 return response, nil
58}
59
60type LogConfiguration struct {
61 logFile string

Callers 8

GetLogConfigurationMethod · 0.95
GetMemoryDumpMethod · 0.95
GetGoroutineDumpMethod · 0.95
GetTunnelStateMethod · 0.95
GetSystemInformationMethod · 0.95
GetMetricsMethod · 0.95
GetCliConfigurationMethod · 0.95

Calls 4

ErrorfMethod · 0.80
StringMethod · 0.65
AddMethod · 0.65
DoMethod · 0.45

Tested by

no test coverage detected