goldb.org home

AS OF MAY 2008, THIS BLOG IS NO LONGER BEING UPDATED.
Visit the new blog at: http://coreygoldberg.blogspot.com



 Wednesday, February 06, 2008

C# .NET 2.0 HTTP GET Class

Sending HTTP Requests from a C# program seems unnecessarily hard.  I wrote a small helper class to deal with sending and timing GET requests:
http://www.goldb.org/httpgetcsharp.html

You use it like this:


public class Program
{
    static void Main(string[] args)
    {
        HTTPGet req = new HTTPGet();
        req.Request("http://www.google.com");
        Console.WriteLine(req.StatusLine);
        Console.WriteLine(req.ResponseTime);
    }
}
#    Comments [2] |
Sunday, February 24, 2008 10:11:23 PM (Eastern Standard Time, UTC-05:00)
Thanks! That helped a lot. :D
Monday, March 17, 2008 5:53:13 AM (Eastern Standard Time, UTC-05:00)
thank you so much for the provided code! this is the first sample that actually worked in my application.
Comments are closed.