Gets or sets the collection of header name/value pairs associated with the request.
using System;
using System.Net;
using System.IO;
using System.Text;
using System.Threading;
publicclass MainClass{
publicstaticvoid Main(){
WebRequest myWebRequest=WebRequest.Create("http://www.google.com");
WebResponse myWebResponse=myWebRequest.GetResponse();
myWebResponse.Close();
Console.WriteLine("\nThe HttpHeaders are \n{0}",myWebRequest.Headers);
}
}