title: Adding authorization to the headers
body: <p>I have the following code:</p>
  
  <pre><code>...
  AuthenticationHeaderValue authHeaders = new AuthenticationHeaderValue("OAuth2", Contract.AccessToken);
  string result = await PostRequest.AuthenticatedGetData(fullUrl, null, authHeaders);
  return result; 
  ...
  
  public static async Task&lt;string&gt; AuthenticatedGetData(string url, FormUrlEncodedContent data, AuthenticationHeaderValue authValue)
  {
  
      HttpClient client = new HttpClient();
      client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(authValue.Parameter);
  
      HttpResponseMessage response = await client.PostAsync(new Uri(url), data);
  
      response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
      response.EnsureSuccessStatusCode();
      string responseBody = await response.Content.ReadAsStringAsync();
      return responseBody;
  }
  </code></pre>
  
  <p>The response = await part just continues an ongoing loop and nothing happens. Any ideas what I am doing wrong?</p>
  
  <p>The question really is, how do I send the following header:</p>
  
  <pre><code>Authorization: OAuth2 ACCESS_TOKEN
  </code></pre>
  
  <p>to an external web api</p>