Equivalent of java.net.URLConnection in .NET -


is there equivalent of java.net.urlconnection class in .net. , example httpwebrequest? else used?

probably closest is:

webrequest req = webrequest.create(url); // note idisposable                                          // should in "using" block, or                                          // otherwise disposed. 

since handle multiple protocols etc. if meaning http - i'd use webclient; simpler httpwebrequest (one of webrequest implementations).

if want download page:

string s; using(var client = new webclient()) {     s = client.downloadstring(url); } 

Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -