Coverage for docs_src / request_form_models / tutorial001_an_py310.py: 100%
10 statements
« prev ^ index » next coverage.py v7.13.3, created at 2026-04-06 01:24 +0000
« prev ^ index » next coverage.py v7.13.3, created at 2026-04-06 01:24 +0000
1from typing import Annotated 1abghcdef
3from fastapi import FastAPI, Form 1abghcdef
4from pydantic import BaseModel 1abghcdef
6app = FastAPI() 1abghcdef
9class FormData(BaseModel): 1abghcdef
10 username: str 1abcdef
11 password: str 1abcdef
14@app.post("/login/") 1abghcdef
15async def login(data: Annotated[FormData, Form()]): 1abghcdef
16 return data 1ijkl