|
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. |

1万+

被折叠的 条评论
为什么被折叠?



