HttpContent.ReadAsAsync 在哪里? [英] Where is HttpContent.ReadAsAsync?
问题描述
我在网络上看到大量使用新 HttpClient
对象(作为新 Web API 的一部分)的示例,应该有 HttpContent.ReadAsAsync
方法.但是,MSDN 没有提到这个方法,IntelliSense也没找到.
它去了哪里,我该如何解决?
看起来是一个扩展方法(在System.Net.Http.Formatting中):
更新:
<块引用>PM> 安装包 Microsoft.AspNet.WebApi.Client
根据 System.Net.Http.Formatting NuGet 包页面,System.Net.Http.Formatting
包现在是旧包,可以在 NuGet 在这里.
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<T>
method. However, MSDN doesn't mention this method, nor does IntelliSense find it.
Where did it go, and how do I work around it?
It looks like it is an extension method (in System.Net.Http.Formatting):
Update:
PM> install-package Microsoft.AspNet.WebApi.Client
According to the System.Net.Http.Formatting NuGet package page, the System.Net.Http.Formatting
package is now legacy and can instead be found in the Microsoft.AspNet.WebApi.Client
package available on NuGet here.
这篇关于HttpContent.ReadAsAsync 在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!