mirror of
https://github.com/fastapi/fastapi.git
synced 2026-11-15 16:15:21 +08:00
11 lines
220 B
Python
11 lines
220 B
Python
from typing import Annotated
|
|
|
|
from fastapi import FastAPI, Form
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.post("/preferences/")
|
|
async def update_preferences(subscribe: Annotated[bool, Form()] = False):
|
|
return {"subscribe": subscribe}
|