title: How to correctly add WebRequest header?
body: <pre><code>var webRequest = WebRequest.Create("https://vtopbeta.vit.ac.in/vtop/");
  webRequest.Method = "GET";
  webRequest.Timeout = 12000;
  webRequest.Headers.Add("User-Agent",
      "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36");
  string jsonResponse;
  using (var s = webRequest.GetResponse().GetResponseStream())
  {
      using (var sr = new StreamReader(s ?? throw new InvalidOperationException()))
      {
          jsonResponse = sr.ReadToEnd();
      }
  }
  </code></pre>
  
  <p>I wrote this yesterday and it worked just fine. Today suddenly this is not working anymore. There is an almost exact question <a href="https://stackoverflow.com/questions/239725/cannot-set-some-http-headers-when-using-system-net-webrequest">Cannot set some HTTP headers when using System.Net.WebRequest</a> but the answer <a href="https://stackoverflow.com/a/4752359/4427870">https://stackoverflow.com/a/4752359/4427870</a> says I cant use <code>User-Agent</code> header but I literally used it a day before. </p>
  
  <p>The error I get: <code>System.ArgumentException: 'The 'User-Agent' header must be modified using the appropriate property or method.
  Parameter name: name'</code></p>
  
  <p>I'd like to use <code>WebRequest</code> and not <code>WebClient</code> or <code>HttpWebRequest</code>.</p>