title: How do I return a generic HttpResponse in .NET 5/Core?
body: <p>I need a controller method to be able to return any kind of responses with arbitrary headers and content. Previously I've been creating and returning the <a href="https://msdn.microsoft.com/en-us/library/system.net.http.httpresponsemessage%28v=vs.118%29.aspx" rel="nofollow">HttpResponseMessage</a>, but I see that this have been changed in the new .NET. <a href="http://www.strathweb.com/2015/01/migrating-asp-net-web-api-mvc-6-exploring-web-api-compatibility-shim/" rel="nofollow">There is a shim</a> I could use by referencing the old familiar classes, but I'd like to do this the .NET Core way (whatever that might be).</p>
  
  <p>We have the <a href="http://docs.asp.net/projects/api/en/latest/autoapi/Microsoft/AspNet/Http/HttpResponse/index.html?highlight=httpresponse" rel="nofollow">Microsoft.AspNet.Http.HttpResponse</a>, but that's abstract.
  I tried to have the controller return a string and thus triggering the plaintext formatter, but the problem is then that it overwrites the ContentType header.</p>
  
  <p>Is there a recommended way to do this in .NET Core?</p>