Skip to content

Instantly share code, notes, and snippets.

@liulixiang1988
Created May 12, 2015 12:26
Show Gist options
  • Save liulixiang1988/442f07fa0ac915462634 to your computer and use it in GitHub Desktop.
Save liulixiang1988/442f07fa0ac915462634 to your computer and use it in GitHub Desktop.
public HttpResponseMessage Post(string version, string environment, string filetype)
{
var path = @"C:\Temp\test.exe";
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
var stream = new FileStream(path, FileMode.Open);
result.Content = new StreamContent(stream);
result.Content.Headers.ContentType =
new MediaTypeHeaderValue("application/octet-stream");
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment