title: HttpResponseMessage Compression Issue
body: <p>I have a web application written in ASP.NET. All is working okay, except that I would like to compress the data being returned. The data is basically a List of custom models. Currently I do something like:</p>
  
  <pre><code>string json_string = new JavaScriptSerializer().Serialize(my_models);
  
  using (var output = new MemoryStream())
  {
      using (var compressor = new Ionic.Zlib.GZipStream(output, Ionic.Zlib.CompressionMode.Compress, Ionic.Zlib.CompressionLevel.BestCompression))
      {
              compressor.Write(Encoding.ASCII.GetBytes(json_string), 0, json_string.Length);
      }
  }
  </code></pre>
  
  <p>I then proceed with the following:</p>
  
  <pre><code>HttpResponseMessage json = Request.CreateResponse(HttpStatusCode.OK, json_string);
  
  json.Content.Headers.Add("content-encoding", "gzip");
  </code></pre>
  
  <p>This causes an application error. In Chrome (through the console), I see the following message:</p>
  
  <p><strong>ERR_CONTENT_DECODING_FAILED</strong></p>
  
  <p>Where am I going wrong here? Thanks!</p>