MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / getClient

Function getClient

cli/pkg/common/http.go:291–303  ·  view source on GitHub ↗
(url string, timeout time.Duration)

Source from the content-addressed store, hash-verified

289}
290
291func getClient(url string, timeout time.Duration) *http.Client {
292 _httpClient := &http.Client{
293 Timeout: timeout, // 请求超时时间
294 }
295 if strings.HasPrefix(url, "https") {
296 tr := &http.Transport{
297 TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
298 }
299 _httpClient.Transport = tr
300 }
301 return _httpClient
302
303}
304
305func getReader(reqParams map[string]interface{}, contentType string, files []UploadFile) (io.Reader, string) {
306 if strings.Contains(contentType, "json") {

Callers 3

getMethod · 0.85
putMethod · 0.85
postMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected