In short, HttpWebRequest gives you more fine grained control over your
request. WebClient does not. It encapsulates most of the stuff for you.
WebClient is very useful if you want to do specialized, one-off tasks, eg:
download file, do forms post etc.
HttpWebRequest is useful if you want to do more complicated stuff.
--
feroze
-----------------
This posting is provided as-is. It offers no warranties and assigns no
rights.
See
http://weblogs.asp.net/feroze_daud for System.Net related posts.
----------------
"Jason Manfield" <Ja***********@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com...
What is the difference (pros and cons) between retrieving data from the
web
using System.Web.WebClient and using HttpWebRequest and Response to get
the
data? The WebClient download methods seem to neatly encapsulate the
multiple
steps (request.Create; request.GetResponse; response.GetResponseStream
...)
required with the traditional HttpWebRequest/Response approach. I am
trying
to crawl urls and download data.