Files
fastapi/docs/tutorial/src/tutorial54.py
2018-12-14 10:07:07 +04:00

9 lines
207 B
Python

from fastapi import FastAPI, File, Form
app = FastAPI()
@app.post("/files/")
async def create_file(*, file: bytes = File(...), token: str = Form(...)):
return {"file_size": len(file), "token": token}