Get HTTP Request Headers : Web Request Response : Network C# Source Code


Custom Search

C# Source Code » Network » Web Request Response »

 

Get HTTP Request Headers








    


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

public class TryHttpRequest {
  public static void Main(String [] args) {
    HttpWebRequest request =(HttpWebRequest)WebRequest.Create("http://www.navioo.com");
    HttpWebResponse response =(HttpWebResponse)request.GetResponse();
    request.Accept = "text/plain";
    Console.WriteLine("Request header count: {0}",request.Headers.Count);
    WebHeaderCollection header = request.Headers;
    for (int i = 0; i < header.Count; i++)
      Console.WriteLine("   {0} : {1}",header.GetKey(i), header[i]);
      
  }
}
           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Network
» Web Request Response