The current status of System.Net.Http vs. Microsoft.Net.Http

后端 未结 1 508
广开言路
广开言路 2021-02-06 22:01

I am confused with packaging of HttpClient. Earlier it was distributed as a part of Microsoft.Http.Net NuGet package while System.Net.Http

相关标签:
1条回答
  • 2021-02-06 22:34

    This has been for a long time and continues to be confusing. I have seen such messaging myself but as of right now, it appears System.Net.Http is the correct choice, at least for .NET on the Windows platform and has no external dependencies.

    For .NET Core, I have used Microsoft.Net.Http although it does require Microsoft.BCL. Unless you are experiencing problems, I suggest leaving legacy systems as-is, especially since these namespaces seem to be moving targets.

    If that isn't confusing enough for you, the HttpClient Sample linked from System.Net.Http uses Windows.Web.Http! That implementation is for Windows Store apps.

    Perhaps next year this will all change again.

    0 讨论(0)
提交回复
热议问题