I have rest controller which is returning HttpResponseMessage with Stream file as a content, something like this:
public class MyController : ApiController
{
public HttpResponseMessage GetFile(string id)
{
try {
var stream = fileSystemUtils.GetFileStream(filePath); //Get Stream
HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
response.Content = stream;
return response;
}
catch (FileNotFoundException)
{
return new HttpResponseMessage(HttpStatusCode.NotFound);
}
}
}
When i call this method by ULR in browser everything is ok and i can download this file. Now i would like to download it using Swagger UI. Is some easy way to do this?