I am working on a ASP .NET mVC project & i have to change HttpHeaders. see the foolowing code snippet:
WebRequest req= HttpWebRequest.Create("myURL");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
req.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.15) Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729)");
req.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
req.Headers.Add("Accept-Language", "en-us,en;q=0.5");
this gives a exception i.e.
This header must be modified using the appropriate property.\r\nParameter name: name.
Anyone suggets solution for it