|
@@ -86,14 +86,14 @@ func (h *HH) HttpFunc() (body []byte, err error, isJson bool) {
|
|
|
// 使用 Do 方法处理请求
|
|
|
resp, _err := client.Do(req)
|
|
|
if _err != nil {
|
|
|
- err = fmt.Errorf("failed to create client:%v", http.StatusInternalServerError)
|
|
|
+ err = fmt.Errorf("failed to create client:%v,err:%s", http.StatusInternalServerError, _err.Error())
|
|
|
return
|
|
|
}
|
|
|
defer resp.Body.Close()
|
|
|
body, err = io.ReadAll(resp.Body)
|
|
|
isJson = strings.Contains(strings.ToLower(resp.Header.Get("Content-Type")), "text/json")
|
|
|
if err != nil {
|
|
|
- log.Println("Failed to read response body", http.StatusInternalServerError)
|
|
|
+ log.Println(fmt.Sprintf("Failed to read response body:%v,err:%s", http.StatusInternalServerError, err.Error()))
|
|
|
return
|
|
|
}
|
|
|
return
|