我喜欢 ASP.NET Web API 中的 HttpClient。我可以在 3.5 或 2.0 中使用它吗?我的意思是在 4.0 之前的任何 .NET Framework 应用程序版本中。实际上,我有一个 ASP.NET 4.0 中的 ASP.NET Web API 应用程序。我需要从 3.5 框架内置的设备上使用这个应用程序。我知道我可以使用 WebClient/WebRequest,但是如果我可以使用 HttpClient 的东西那就太好了。
最佳答案
根据this ,
WebAPI requires .net 4. You can't use it on .net 3.5 (sp1 or not).
You also can't use the preview releases for production code as you don't have a "go-live" license, so even if you could get it to work, it wouldn't be legal. You need to use at least the ASP.NET WebAPI Beta to get a go-live license.
根据this ,
The HttpClient library was initially introduced in the "WCF REST Starter Kit" project, so you can download it from there. This project isn't supported anymore (most of its functionality has either made it into the framework or is now part of the Web API project), but the HttpClient from there works quite well.
关于asp.net-mvc - 3.5 或 2.0 应用程序上的 ASP.NET Web API HttpClient?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12173932/