I can read JS FormData with Python FastAPI from my HTML code like this:
<form>
<input type ="number" name="test1">
</form>
Python FastAPI:
@app.post("/zip")
async def buildScaffolding( test1: int=Form(...)):
print(test1)
return ""
But now I want to change the HTML form dynamically. Like when you buy items in a shop:
<form>
<input type ="number" name="numberItems">
<!-- item 1-->
<input type ="text" name="item_1">
<!-- item 2-->
<input type ="text" name="item_2">
...
<!-- item n-->
<input type ="text" name="item_n">
</form>
Question: How can I process the input with Python FastAPI, if I don´t know how many items will be sent?