HttpWebResponse.GetResponseStream() : HttpWebResponse « System.Net « C# / C Sharp by API






HttpWebResponse.GetResponseStream()

  

using System;
using System.Net;
using System.IO;

public class WebApp {
    public static void Main() {
        String page = "http://www.yoursite.net/index.html";
        HttpWebRequest site = (HttpWebRequest)WebRequest.Create(page);
        HttpWebResponse response =(HttpWebResponse)site.GetResponse();
        Stream dataStream = response.GetResponseStream();
        StreamReader read = new StreamReader(dataStream);
        String data = read.ReadToEnd();
        Console.WriteLine(data);
    }
}

   
    
  








Related examples in the same category

1.HttpWebResponse.Cookies
2.HttpWebResponse.Headers.AllKeys
3.HttpWebResponse.LastModified