💭 Form Data - FastAPI ===================== !https://fastapi.tiangolo.com/tutorial/request-forms/#define-form-parameters Date: July 28, 2023 Form Data - FastAPI FastAPI framework, high performance, easy to learn, fast to code, ready for production fastapi.tiangolo.com [1] Getting form data inside of fastapi was not intuitive to me at first. Everything I had used in fastapi leaned on pydantic models. Form data comes in differently and needs collected differently. ``` python from typing import Annotated from fastapi import FastAPI, Form app = FastAPI() @app.post("/login/") async def login(username: Annotated[str, Form()], password: Annotated[str, Form()]): return {"username": username} ``` !!! note This post is a thought [2]. It's a short note that I make about someone else's content online #thoughts [3] References: [1]: https://fastapi.tiangolo.com/tutorial/request-forms/#define-form-parameters [2]: /thoughts/ [3]: /tags/thoughts/