title: httpResponseMessage.TryGetContentValue not working
body: <p>Calling httpResponseMessage.TryGetContentValue is not behaving as expected.</p>
  
  <p>I have a WebAPI method that returns an IHttpActionResult. If the user passes in the incorrect parameters, I want to send back a response with a custom message, so I have the following. Note where I add a message string to the Content property.</p>
  
  <pre><code>[HttpGet]
  public IHttpActionResult ActionResultErrorTest(int id)
  {
      var payload = "";
      if (id == 0)
      {
          var resp = new HttpResponseMessage(HttpStatusCode.NotFound)
          {
          Content = new StringContent(string.Format("No product with ID = {0}", id)),
              ReasonPhrase = "Product ID Not Found",
  
          };
          throw new HttpResponseException(resp);
      }
  
      payload = "Success";
  
      return Ok(payload);
  }
  </code></pre>
  
  <p>So far, so good. Next, I have a DelegatingHandler that augments the response. In this code, I call the HttpResponseMessage.TryGetContentValue() extension method.
  [Clarification on my Confusion]
  For ActionResultErrorTest(0), the extension method returns false.
  For ActionResultErrorTest(1), the extension method returns true.
  I don't understand this since in both cases, the Content contains a string.</p>
  
  <p>Here is the delegating handler code:</p>
  
  <pre><code>    protected override async Task&lt;HttpResponseMessage&gt; SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
      {
          //Step 1: Wait for the Response
          var response = await base.SendAsync(request, cancellationToken);
          if (request.RequestUri.AbsoluteUri.Contains("swagger"))
          {
              return response;
          }
          return BuildApiResponse(request, response);
  
      }
  
      private HttpResponseMessage BuildApiResponse(HttpRequestMessage request, HttpResponseMessage response)
      {
          object content;
          List&lt;string&gt; modelStateErrors = new List&lt;string&gt;();
          bool hasContent = response.TryGetContentValue(out content);
          string content2;
          bool hasContentString = response.TryGetContentValue&lt;string&gt;(out content2);
          string dialogTitle = "";
          bool preventUserInput = false;
  ...
  </code></pre>
  
  <p>In the above code, even though I set Content = "No product with ID = 0", content and content2 evaluate to NULL and hasContent and hasContent2 both evaluate to false</p>