Skip to content

Instantly share code, notes, and snippets.

@bjartwolf
Last active January 3, 2016 23:49
Show Gist options
  • Save bjartwolf/8537113 to your computer and use it in GitHub Desktop.
Save bjartwolf/8537113 to your computer and use it in GitHub Desktop.
filestream
[Route("")]
public HttpResponseMessage GetResult()
{
var fs = new FileStream(@"C:\data\medline13n0701.xml.gz"), FileMode.Open);
var response = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StreamContent(fs)
};
response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/xml");
response.Content.Headers.ContentEncoding.Add("gzip");
return response;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment