Created
November 4, 2010 03:26
-
-
Save RiverGlide/662095 to your computer and use it in GitHub Desktop.
CSharp Web Request Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Net | |
var request = WebRequest.Create("http://google.com") as HttpWebRequest; | |
using (var response = request.GetResponse() as HttpWebResponse) | |
{ | |
var reader = new StreamReader(response.GetResponseStream()); | |
Console.WriteLine(reader.ReadToEnd();); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment