MCPcopy
hub / github.com/larksuite/cli / NewHTTPClient

Function NewHTTPClient

internal/transport/shared.go:66–71  ·  view source on GitHub ↗

NewHTTPClient returns an *http.Client whose Transport is the shared, proxy-plugin-aware base (see Shared). Prefer this over a bare &http.Client{} for outbound requests: a bare client falls back to http.DefaultTransport and therefore silently bypasses proxy plugin mode (fixed proxy + trusted CA, or f

(timeout time.Duration)

Source from the content-addressed store, hash-verified

64// A zero timeout means no client-level timeout (callers relying on context
65// deadlines pass 0).
66func NewHTTPClient(timeout time.Duration) *http.Client {
67 return &http.Client{
68 Transport: Shared(),
69 Timeout: timeout,
70 }
71}
72
73// noProxyTransport is a proxy-disabled clone of http.DefaultTransport, lazily
74// built the first time LARK_CLI_NO_PROXY is observed set.

Callers 5

fetchRemoteMergedFunction · 0.92
networkChecksFunction · 0.92
runCreateAppFlowFunction · 0.92
TestNewHTTPClientFunction · 0.85

Calls 1

SharedFunction · 0.85

Tested by 1

TestNewHTTPClientFunction · 0.68