From a service method that uses this to output a stream:
var result = new HttpResult(myStream, "application/octet-stream");
result.Headers.Add("Content-Disposition", "attachment;filename=" + request.FileName);
return result;
It doesn’t look like it’s fixed in any version of swagger-ui, but I was curious how I would implement the workaround described in this comment:
In the comment he says that GET request works fine while POST fails. Do you have an issue with POST only requests like the author of the comment has or you get an issue with both GET and POST verbs?
I did not get how exactly he workarounded the issue because I tried to make GET and POST and I see that the length of file by the link is doubled and file corrupted in both cases.
Yeah, you’re right, GET is broken for me as well. I guess we’ll have to wait until swagger-ui fixes their bug and it gets embedded into ServiceStack… (I know I can override but don’t really want to maintain my own swagger-ui distro).