HttpClient Verses WebClient with .Net and C#

Posted by Peter Kellner on January 09, 2013 · 1 min read
Ad: Learn Modern JavaScript on YouTube (3 Hours & Free)

I often find I do what I know over and over again and don’t look for new solutions if the old tried and true solution works.  At my last hackathon, I wrote an app the screen scraped the starbucks site.  I noticed when I looked at the site that a redirect happened after sign in.  My WebClient call did not follow the redirect.  I asked for help from a very bright Microsoft Azure guy (Josh Twist) who blogs at  Josh suggested switching to HttpClient and making sure to set the option that follows redirects.

Perfect!  I’m hooked on HttpClient now forever. WebClient is now just in my rear view mirror.