Post values from an HTML form and access them in a Flask view

前端 未结 2 1445
北荒
北荒 2020-11-22 15:34

I have an HTML form that gets posted to a Flask route. However, request.form is empty. If I try to access one of the values by id, I get a 400 error. How do

2条回答
  •  情深已故
    2020-11-22 16:00

    Your input doesn't have a name attribute. That is what the client will pass along to the server. Flask will raise a 400 error if you access a form key that wasn't submitted.

    
    

提交回复
热议问题