title: How do I remove headers from my Web API response?
body: <p>New Web API 2.0 project so we have full control over the entire request / response pipeline.</p>
  
  <p>How do we remove the "X-" headers from a response sent by ASP.NET Web API response? Specifically, at the moment and always subject to change, we want to remove "<code>X-AspNet-Version</code>", "<code>X-Powered-By</code>", and "<code>X-SourceFiles</code>".</p>
  
  <p>We tried <code>result.Headers.Remove("X-AspNet-Version");</code> before returning the <code>HttpResponseMessage</code> from the controller. That didn't work as the headers still appeared in Fiddler. I also didn't find any headers anywhere on the <code>HttpResponseMessage</code> object. To me, this indicated I may need to dig deeper into the pipeline but I'm not sure where to start or if that's correct.</p>