title: Is the Content-Type charset not exposed from HttpResponseMessage?
body: <p>I'm converting some code from using <code>HttpWebRequest</code> to <code>HttpClient</code>. One problem I'm having is getting the charset from the content-type response header.</p>
  
  <p>When using <code>HttpWebRequest</code>, the charset is exposed in the <code>HttpWebResponse.CharacterSet</code> property, like this</p>
  
  <pre><code>using (WebResponse response = await this.webRequest.GetResponseAsync())
  {
       string characterSet = ((HttpWebResponse)response).CharacterSet;
  </code></pre>
  
  <p>You can also get to it from <code>WebResponse.ContentType</code> property or from the content-type header in <code>HttpWebResponse.Headers</code>.</p>
  
  <p>Using <code>HttpClient</code>, the charset seems to be missing from the <code>ContentType</code> header.</p>
  
  <p>Here's the code that I'm using for <code>HttpClient</code>:</p>
  
  <pre><code>using (HttpClient httpClient = new HttpClient(httpClientHandler))
  {
      using (HttpResponseMessage httpResponseMessage = await httpClient.GetAsync(uri, HttpCompletionOption.ResponseContentRead))
      {
          charset = httpResponseMessage.Content.Headers.ContentType.CharSet;
  </code></pre>
  
  <p>The CharSet property is always <code>null</code>.  <code>HttpResponseMessage</code> has a <code>Headers</code> property but it doesn't contain the content-type header.  <code>HttpResponseMessage.Content</code> also has a Headers property, which does appear to contain the content-type header, but that header shows <code>"Content-Type: text/html"</code> - it doesn't have the charset portion.</p>
  
  <p>Using the first approach with <code>HttpWebResponse</code> for the same url, I get the charset portion of the Content-Type header.  Am I missing something?</p>