Where is HttpContent.ReadAsAsync?

后端 未结 6 1134

I see in tons of examples on the web using the new HttpClient object (as part of the new Web API) that there should be HttpContent.ReadAsAsync

6条回答
  •  既然无缘
    2020-11-29 18:13

    If you are already using Newtonsoft.Json and don't want to install Microsoft.AspNet.WebApi.Client:

     var myInstance = JsonConvert.DeserializeObject(
       await response.Content.ReadAsStringAsync());
    

提交回复
热议问题