Answered by:
HttpClient in Windows.Web.Http and System.Net.Http

Question
-
I am developing Windows universal store app and i am using the HttpClient class for communication.
I see that HttpClient is in both Windows.Web.Http and System.Net.Http, which namespace should i use and what is difference between Windows.Web.Http(HttpClient) and System.Net.Http(HttpClient).
Thanks,
Srini
- Moved by Amy PengMicrosoft employee, Moderator Friday, April 3, 2015 2:49 AM
Thursday, April 2, 2015 11:53 AM
Answers
-
Hi Sriusav26,
The System.Net.Http(HttpClient) is available in the Windows Store 8.0/8.1 app while the Windows.Web.Http(HttpClient) is avaiable in the Windows Store 8.1 app/Windows Phone 8.1. Based on this article, it says that the System.Net.Http 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, please use Windows.Web.Http.HttpClient in the Windows.Web.Http namespace.
For more information about the difference, please try to refer to the following articles:
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh781239.aspx .
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn440594.aspx .Best Regards,
Amy PengWe are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Can Bilgin Saturday, April 4, 2015 6:10 AM
- Marked as answer by Amy PengMicrosoft employee, Moderator Friday, April 17, 2015 2:19 AM
Friday, April 3, 2015 2:48 AMModerator
All replies
-
Hi Sriusav26,
The System.Net.Http(HttpClient) is available in the Windows Store 8.0/8.1 app while the Windows.Web.Http(HttpClient) is avaiable in the Windows Store 8.1 app/Windows Phone 8.1. Based on this article, it says that the System.Net.Http 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, please use Windows.Web.Http.HttpClient in the Windows.Web.Http namespace.
For more information about the difference, please try to refer to the following articles:
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh781239.aspx .
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn440594.aspx .Best Regards,
Amy PengWe are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Can Bilgin Saturday, April 4, 2015 6:10 AM
- Marked as answer by Amy PengMicrosoft employee, Moderator Friday, April 17, 2015 2:19 AM
Friday, April 3, 2015 2:48 AMModerator -
Thanks Peng..Friday, April 3, 2015 6:13 AM