Skip to content

Instantly share code, notes, and snippets.

@RiverGlide
Created November 4, 2010 03:26
Show Gist options
  • Save RiverGlide/662095 to your computer and use it in GitHub Desktop.
Save RiverGlide/662095 to your computer and use it in GitHub Desktop.
CSharp Web Request Example
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