Files
fastapi/docs/tutorial/src/tutorial47-04.py
Sebastián Ramírez 7da0233e35 📝 Add first tutorial src files
2018-12-13 21:05:15 +04:00

12 lines
322 B
Python

from fastapi import Body, FastAPI, Path, Query, File, Form
from pydantic import BaseModel
from pydantic.types import EmailStr
from typing import Set, List
app = FastAPI()
@app.post("/files/")
async def create_file(*, file: bytes = File(...), token: str = Form(...)):
return {"file_size": len(file), "token": token}