mirror of
https://github.com/fastapi/fastapi.git
synced 2026-09-14 13:36:21 +08:00
10 lines
233 B
Python
10 lines
233 B
Python
|
|
from fastapi import FastAPI, Form
|
||
|
|
from typing_extensions import Annotated
|
||
|
|
|
||
|
|
app = FastAPI()
|
||
|
|
|
||
|
|
|
||
|
|
@app.post("/login/")
|
||
|
|
async def login(username: Annotated[str, Form()], password: Annotated[str, Form()]):
|
||
|
|
return {"username": username}
|