WebClient |
HttpClient
Available in older version of .NET
.NET 4.5 only. Created to support the growing need of the Web API REST calls
WinRT applications cannot use WebClient
HttpClient can be used with WinRT
Provides progress reporting for downloads.
No progress reporting for downloads.
Does not reuse resolved DNS, configured-cookies.
Can resuse resolved DNS, cookie configuration and other authentication.
You need to new up a WebClient to make concurrent request.
Single HttpClient can make concurrent requests.
Thin layer over WebRequest and WebResponse
Thin layer over HttpWebRequest and HttpWebResponse
Mocking and testing WebClient is difficult
Mocking and testing HttpClient is easy
Supports FTP.
No support for FTP.
Both synchronous and Asynchronous methods are available for IO bound requests.
All IO bound methods in HTTPClient are asynchronous.
原文地址:http://blogs.k10world.com/technology/webclient-httpclient-consume-http-requests/