diff --git a/weipinshang_api/wei_pin_shang_client.go b/weipinshang_api/wei_pin_shang_client.go index 14a7c3c..558c00a 100644 --- a/weipinshang_api/wei_pin_shang_client.go +++ b/weipinshang_api/wei_pin_shang_client.go @@ -8,6 +8,7 @@ import ( "errors" "fmt" "io" + "log" "net/http" "strings" ) @@ -268,6 +269,7 @@ func (w *WeiPinShangClient) WPSPost(url string, paramMap map[string]any) (res [] if err != nil { return } + //req.Proto = "HTTP/2" req.Header.Set("Content-Type", "application/json") req.Header.Set("channelType", w.ChannelType) @@ -276,13 +278,15 @@ func (w *WeiPinShangClient) WPSPost(url string, paramMap map[string]any) (res [] return } req.Header.Set("md5", sign) - + log.Printf("WPSPost req: %+v\n", req) // 创建 HTTP 客户端 client := &http.Client{} - + log.Printf("WPSPost client: %+v\n", client) // 发送请求 resp, err := client.Do(req) + log.Printf("WPSPost resp: %+v\n", resp) if err != nil { + log.Printf("发送请求失败: %+v\n", err) return } defer func(Body io.ReadCloser) { diff --git a/weipinshang_api/wei_pin_shang_client_test.go b/weipinshang_api/wei_pin_shang_client_test.go index b583762..82e58a6 100644 --- a/weipinshang_api/wei_pin_shang_client_test.go +++ b/weipinshang_api/wei_pin_shang_client_test.go @@ -292,7 +292,7 @@ func TestWeiPinShangClient_GetOrderInfoByThirdNO(t *testing.T) { Key: "f654ea5bde7635c3f46191191e5c4c8e", }, args: args{ - orderNo: "570872619444771455", + orderNo: "570853643339733632", }, }, }