mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-25 23:29:34 -05:00
* ✨ Do not require default value in Query(), Path(), Header(), etc * 📝 Update source examples for docs with default and required values * ✅ Update tests with new default values and not required Ellipsis * 📝 Update docs for Query params and update info about default value, required, Ellipsis
9 lines
173 B
Python
9 lines
173 B
Python
from fastapi import FastAPI, Form
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.post("/login/")
|
|
async def login(username: str = Form(), password: str = Form()):
|
|
return {"username": username}
|