fastapi/docs/tutorial/src/tutorial53.py
2018-12-13 21:48:37 +04:00

8 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}