Created
October 18, 2018 12:36
-
-
Save Shaddix/f22feaffcc99fe653d8b8455ee967e19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpGet("/q1")] | |
public IActionResult Get() | |
{ | |
return new FileCallbackResult(new MediaTypeHeaderValue("application/octet-stream"), | |
async (stream, context) => | |
{ | |
context.HttpContext.Response.Body.Flush(); | |
await Task.Delay(4000); | |
var data = Encoding.UTF8.GetBytes("asdaasdfasdfasdfasdfasdsdasdasd"); | |
stream.Write(data, 0, data.Length); | |
}) | |
{ | |
FileDownloadName = "README.md" | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment