HttpClient post json,可以是数组
var json = JsonConvert.SerializeObject(obj); StringContent theContent = new StringContent(json, Encoding.UTF8, "application/json"); var r = client.PostAsync(url, theContent).Result.Content.ReadAsStringAsync().Result;
有简单一点的方法
client.PostAsJsonAsync(url, new {});需要引入System.Net.Http.Formatting.dll