title: How to modify request headers in c#,ASP .NET
body: <p>I am working on a ASP .NET mVC project &amp; i have to change HttpHeaders. see the foolowing code snippet:</p>
  
  <pre><code>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");
  </code></pre>
  
  <p>this gives  a exception i.e.</p>
  
  <blockquote>
    <p>This header must be modified using the appropriate property.\r\nParameter name: name.</p>
  </blockquote>
  
  <p>Anyone suggets solution for it</p>