(url string, timeout time.Duration)
| 289 | } |
| 290 | |
| 291 | func 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 | |
| 305 | func getReader(reqParams map[string]interface{}, contentType string, files []UploadFile) (io.Reader, string) { |
| 306 | if strings.Contains(contentType, "json") { |