You are following a PHP convention of adding brackets to the field names. It’s not a web standard, but because PHP supports it out of the box it is popular; Ruby on Rails also uses it.
If you do use that convention, to get the POST data on the Flask side you need to include the square brackets in the field name. You can retrieve all values of the list using MultiDict.getlist()
:
hello = request.form.getlist('hello[]')
You don’t have to use the []
convention at all, of course. Not appending the []
to the hello
name will work perfectly fine, at which point you’d use request.form.getlist('hello')
in Flask.