肖洋
2025-01-04 e59d1777a111b6573b93afc58cca18c8c026ed9b
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs
@@ -54,6 +54,8 @@
            // 将参数转换为FormUrlEncodedContent
            string content = JsonConvert.SerializeObject(parameters);
            //client.Timeout = TimeSpan.from;
            var request = new HttpRequestMessage(HttpMethod.Post, url);
            request.Content = new StringContent(content, Encoding.UTF8, "application/json");
@@ -78,12 +80,23 @@
    private static void LogRequestParameters(Dictionary<string, object> parameters,string url = "")
    {
        LogFactory.GetLog("API接口").Info(true, "url:" + url + "请求参数: " + JsonConvert.SerializeObject(parameters));
        StringBuilder builder = new StringBuilder();
        builder.Append(Environment.NewLine);
        builder.Append("---------------------------------------------");
        builder.Append(Environment.NewLine);
        builder.Append("url:" + url + "请求参数: " + JsonConvert.SerializeObject(parameters));
        LogFactory.GetLog("API接口").Info(true, builder);
    }
    private static void LogResponseParameters(string responseBody, string url = "")
    {
        LogFactory.GetLog("API接口").Info(true, "url:" + url + "响应参数: " + responseBody);
        StringBuilder builder = new StringBuilder();
        builder.Append(Environment.NewLine);
        builder.Append("url:" + url + "响应参数: " + responseBody);
        builder.Append(Environment.NewLine);
        builder.Append("---------------------------------------------");
        builder.Append(Environment.NewLine);
        LogFactory.GetLog("API接口").Info(true, builder);
    }
    private static IEnumerable<KeyValuePair<string, string>> ConvertToKeyValuePairs(Dictionary<string, object> parameters)