Jelajahi Sumber

修改contentType

黄贺彬 6 tahun lalu
induk
melakukan
f0836457ee

+ 3 - 1
TEAMModelOS.Model/Evaluation/Dtos/DocInfoDto.cs

@@ -1,10 +1,12 @@
-using System;
+using MessagePack;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
 using System.Text;
 
 namespace TEAMModelOS.Model.Evaluation.Dtos
 {
+    [MessagePackObject(keyAsPropertyName: true)]
     public class DocInfoDto
     {
         [Required(ErrorMessage = "{0} 必须填写")]

+ 1 - 1
TEAMModelOS.SDK/Helper/Network/HttpHelper/HttpHelper.cs

@@ -104,7 +104,7 @@ namespace TEAMModelOS.SDK.Helper.Network.HttpHelper
         /// <param name="timeout">请求响应超时时间,单位/s(默认100秒)</param>
         /// <param name="encoding">默认UTF8</param>
         /// <returns></returns>
-        public static async Task<string> HttpPostAsync(string url, string postData, Dictionary<string, string> headers = null, string contentType = null, int timeout = 0, Encoding encoding = null)
+        public static async Task<string> HttpPostAsync(string url, string postData, Dictionary<string, string> headers = null, string contentType = "application/json", int timeout = 1000, Encoding encoding = null)
         {
             HttpClient client = new HttpClient();
             if (headers != null)