How do I set the content encoding on a HttpResponseMessage

The ContentEncoding property is an instance of ICollection.

This provides .Add() and .Clear() methods for controlling the contents.


Not to detract from richzilla's answer which is of course totally correct and answered my question. Seeing as this is getting a few votes and visits there must be other people making the same mistake I did so it's worth saying the complete answer to my problem was

result.Content.Headers.ContentEncoding.Add("gzip");