HttpClient not supporting PostAsJsonAsync method C#

前端 未结 12 997
花落未央
花落未央 2020-11-27 10:37

I am trying to call a web API from my web application. I am using .Net 4.5 and while writing the code I am getting the error HttpClient does not contain a defin

12条回答
  •  [愿得一人]
    2020-11-27 11:06

    Instead of writing this amount of code to make a simple call, you could use one of the wrappers available over the internet.

    I've written one called WebApiClient, available at NuGet... check it out!

    https://www.nuget.org/packages/WebApiRestService.WebApiClient/

提交回复
热议问题