title author date CreateTime categories
win10 uwp HttpClient post错误
lindexi
2018-2-13 17:23:3 +0800
2018-2-13 17:23:3 +0800
Win10 UWP

进行HttpClient post参数错误 从“Windows.Web.Http.HttpStringContent”转换为“System.Net.Http.HttpContent”

原因

用了System.Net.Http.HttpClient其实HttpStringContent是可以在错误看到,不是System.Net.Http

方法

使用

           Windows.Web.Http.HttpClient webHttpClient=
                new Windows.Web.Http.HttpClient();

           Windows.Web.Http.HttpStringContent httpString=
                new HttpStringContent("a");
            await webHttpClient.PostAsync(new Uri(url), httpString);

CodeProject

相关文章:

  • 2021-05-21
  • 2021-10-12
  • 2021-12-05
  • 2021-12-03
  • 2021-05-03
  • 2021-10-19
猜你喜欢
  • 2021-04-06
  • 2021-11-05
  • 2021-09-09
  • 2021-10-01
  • 2022-02-02
  • 2022-01-01
相关资源
相似解决方案