In my APIController.cs Get() method, how can I return a IHttpActionResult with HTTP status code 200 and pass in a memory stream in the HTTP response?
I tried doing this:
var sr = new StreamReader(myMemoryStream);
string myStr = sr.ReadToEnd();
return Ok(myStr);
But it converts my memory stream to string and pass that to Ok(). But I don't want to my memory stream to stream before sending in http respone. And I don't see any method in the OkResult object which allows me to set the response stream.
How can I set the http response body?