media-type

How to return and download Excel file using FastAPI?

How to return and download Excel file using FastAPI? Question: How do I return an excel file (version: Office365) using FastAPI? The documentation seems pretty straightforward. But, I don’t know what media_type to use. Here’s my code: import os from fastapi import FastAPI from fastapi.responses import FileResponse from pydantic import BaseModel from typing import Optional …

Total answers: 1