When developing .NET 4.5 desktop apps for Windows I have been used to use System.Net.Http.HttpClient
for all communication with a backend Web API. I am now developing a Windows Store app and has noticed the existence of Windows.Web.Http.HttpClient
. I have looked for information on what the main differences are between the two clients but without any luck.
From MSDN I know that I should start using Windows.Web.Http.HttpClient
in my Windows Store app since System.Net.Http.HttpClient
might be removed from the API:
Note The System.Net.Http and System.Net.Http.Headers namespace might not be available in future versions of Windows for use by Windows Store apps. Starting with Windows 8.1 and Windows Server 2012 R2, use Windows.Web.Http.HttpClient in the Windows.Web.Http namespace and the related Windows.Web.Http.Headers and Windows.Web.Http.Filters namespaces instead for Windows Runtime apps.
But apart from this information, I have a hard time figuring out what are the main differences and what is the main benefit of using Windows.Web.Http.HttpClient
? What does it add that we don't already got in System.Net.Http.HttpClient
?
Answers backed by official documentation are greatly appreciated.
question from:
https://stackoverflow.com/questions/31291008/system-net-http-httpclient-vs-windows-web-http-httpclient-what-are-the-main-di 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…