How to configure Swagger so that Excel can be downloaded successfully?

does anyone know how to configure Swagger to support downloading Excel?

clipboard.png

: can"t be opened for some reason

: Flask + flasgger




clipboard.png

Mar.13,2021

you should set the Accept of the request to application/octet-stream .
this is really strange, because normally the Accept of Excel files is application/vnd.ms-excel .
but since flasgger uses swagger-ui as the front end, Swagger sends file class requests using superagent , using blob technology, and needs to set xhr's ResponseType to blob .
We see flasgger_static/lib/http.js :

.
   

Menu