mirror of
https://github.com/fastapi/fastapi.git
synced 2026-02-26 03:36:14 -05:00
📝 Add first tutorial src files
This commit is contained in:
11
docs/tutorial/src/tutorial47-04.py
Normal file
11
docs/tutorial/src/tutorial47-04.py
Normal file
@@ -0,0 +1,11 @@
|
||||
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}
|
||||
Reference in New Issue
Block a user