Skip to content

Instantly share code, notes, and snippets.

@bjartwolf
Created December 30, 2013 20:14
Show Gist options
  • Save bjartwolf/8187481 to your computer and use it in GitHub Desktop.
Save bjartwolf/8187481 to your computer and use it in GitHub Desktop.
public class FastController : ApiController
{
[Route("")]
public HttpResponseMessage GetResult()
{
var fs = new FileStream(Path.Combine(HttpRuntime.AppDomainAppPath, "medline13n0701.xml.gz"), FileMode.Open);
var response = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StreamContent(fs)
};
response.Content.Heades.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