HttpWebResponse.Headers.AllKeys : HttpWebResponse « System.Net « C# / C Sharp by API






HttpWebResponse.Headers.AllKeys

  
using System; 
using System.Net; 
 
public class HeaderDemo {  
  public static void Main() { 
 

    HttpWebRequest req = (HttpWebRequest) WebRequest.Create("http://www.osborne.com"); 
 
    HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); 
 
    string[] names = resp.Headers.AllKeys; 
 
    Console.WriteLine("{0,-20}{1}\n", "Name", "Value"); 
    foreach(string n in names) 
      Console.WriteLine("{0,-20}{1}", n, resp.Headers[n]); 
 
    resp.Close(); 
  } 
}

   
    
  








Related examples in the same category

1.HttpWebResponse.Cookies
2.HttpWebResponse.GetResponseStream()
3.HttpWebResponse.LastModified