哪里是HttpContent.ReadAsAsync? [英] Where is HttpContent.ReadAsAsync?
问题描述
我吨使用新的的HttpClient
对象(如新的Web API的一部分)在网络上的例子,应该有看到 HttpContent .ReadAsAsync< T>
方法。然而,<一个href=\"http://msdn.microsoft.com/en-us/library/system.net.http.httpcontent_methods%28v=vs.110%29.aspx\">MSDN没有提到这个方法,也没有智能感知找到它。
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?
推荐答案
看起来这是一个扩展方法(在System.Net.Http.Formatting):
It looks like it is an extension method (in System.Net.Http.Formatting):
更新:
PM>安装包Microsoft.AspNet.WebApi.Client
PM> install-package Microsoft.AspNet.WebApi.Client
按照 System.Net.Http.Formatting 的NuGet包页面时, System.Net.Http.Formatting
包现在是遗产,而是可以在 Microsoft.AspNet.WebApi.Client
包中找到可在的NuGet这里。
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屋!