title: Using HttpRequestHeaders in WinRT & C#
body: <p>I'm using HttpWebRequests to contact an API and need to add a header but the compiler tells me that the method does not exists.
  Yet, when I check MSDN, it tells me that the method already exists.
  Setting my UserAgent-property fails as well.</p>
  
  <p>Can anyone help me please?</p>
  
  <pre><code>try{
       HttpWebRequest wr = (HttpWebRequest)HttpWebRequest.Create(url);
       wr.Method = "GET";
  
       wr.Headers.Add(System.Net.HttpRequestHeader.Authorization, string.Format("Bearer {0}", _accessToken));
       wr.UserAgent = _appNameAndContact;
  
       var resp = (System.Net.HttpWebResponse) await wr.BetterGetResponse();
       if (resp.StatusCode == System.Net.HttpStatusCode.OK)
       {
          using (var sw = new System.IO.StreamReader(resp.GetResponseStream()))
          {
               var msg = sw.ReadToEnd();
  
               User usr = JsonConvert.DeserializeObject&lt;User&gt;(msg);
  
                //var results = JSONHelper.Deserialize&lt;User&gt;(msg);
  
                return usr;
                }
          }
  }
  </code></pre>