title: Set Authorization Header of HttpClient
body: <p>I have the following code, and I want to set the Authorization of the post request to be like this:</p>
  
  <p><code>Authorization:key=somevalue</code></p>
  
  <pre><code>using (HttpClient client = new HttpClient())
  {
       using (StringContent jsonContent = new StringContent(json))
       {
           jsonContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
  
           using (HttpResponseMessage response = await client.PostAsync("https://android.googleapis.com/gcm/send", jsonContent))
           {
              var reponseString = await response.Content.ReadAsStringAsync();
           }
       }
  }
  </code></pre>
  
  <p>how to do this? I am really struggling
  and the following statement</p>
  
  <pre><code>client.DefaultRequestHeaders.Add("Authorization", "key=" + apiKey);
  </code></pre>
  
  <p>thrown the following exception</p>
  
  <blockquote>
    <p>An exception of type 'System.FormatException' occurred in
    System.Net.Http.dll but was not handled in user code</p>
  </blockquote>