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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-05
  • 2022-12-23
  • 2021-07-29
  • 2021-12-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案