What is the difference between :
>
WebClient client = new WebClient();
client.UploadFi le(url,path);
And the option of using:
>
HttpWebRequest myReq =
(HttpWebRequest )WebRequest.Cre ate(httpPath);
for the purpose of uploading zip file to some http location?
The second option is used to *download*, not upload a file from that location.
>What is the difference between :
>>
>WebClient client = new WebClient();
>client.UploadF ile(url,path);
>And the option of using:
>>
>HttpWebReque st myReq =
>(HttpWebReques t)WebRequest.Cr eate(httpPath);
>for the purpose of uploading zip file to some http location?
>
The second option is used to *download*, not upload a file from that
location.
Not necessarily.
(Http)WebReques t is perfectly capable of sending a POST request
that uploads data.
What is the difference between :
>
WebClient client = new WebClient();
client.UploadFi le(url,path);
>
And the option of using:
>
HttpWebRequest myReq =
(HttpWebRequest )WebRequest.Cre ate(httpPath);
>
for the purpose of uploading zip file to some http location?
WebClient is a very high level class that provides some
convenience methods.
(Http)WebReques t is a more low level class (but still way
above TcpClient) that gives you access to headers and
streams.
Comment