mirror of
https://github.com/fastapi/fastapi.git
synced 2026-02-25 19:29:45 -05:00
12 lines
276 B
Python
12 lines
276 B
Python
from fastapi import Body, FastAPI, Path, Query, File
|
|
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(...)):
|
|
return {"file_size": len(file)}
|