I am trying to submit data from html forms and on the validate it with pydantic model. Using this code
from fastapi import FastAPI, Form from pydantic im
you can use data-form like below:
@app.post("/form", response_model=SimpleModel) def form_post(no: int = Form(...),nm: str = Form(...)): return SimpleModel(no=no,nm=nm)