From 36343b85b0c883ebfdf3c17b173f263fd2bfcb93 Mon Sep 17 00:00:00 2001 From: 陈勇 <chenyong@hnkhzn.com> Date: 星期二, 19 十一月 2024 10:25:53 +0800 Subject: [PATCH] 合并 --- Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs index 0800faf..571ea6a 100644 --- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs +++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs @@ -52,10 +52,15 @@ using (HttpClient client = new HttpClient()) { // 灏嗗弬鏁拌浆鎹负FormUrlEncodedContent - var content = new FormUrlEncodedContent(ConvertToKeyValuePairs(parameters)); + string content = JsonConvert.SerializeObject(parameters); - // 鍙戦�丳OST璇锋眰骞惰幏鍙栧搷搴� - HttpResponseMessage response = await client.PostAsync(url, content); + var request = new HttpRequestMessage(HttpMethod.Post, url); + + request.Content = new StringContent(content, Encoding.UTF8, "application/json"); + //var content = new FormUrlEncodedContent(ConvertToKeyValuePairs(parameters)); + //// 鍙戦�丳OST璇锋眰骞惰幏鍙栧搷搴� + //HttpResponseMessage response = await client.PostAsync(url, content); + HttpResponseMessage response = await client.SendAsync(request); // 纭繚鍝嶅簲鎴愬姛 response.EnsureSuccessStatusCode(); -- Gitblit v1.9.3