Closed LucasGrasso closed 1 year ago
Oy... that's an ugly hack. I would use getlist
The request.form object is one of a few types that is a dictionary with each value being a list. This is because HTTP allows a single key to be reused to send multiple values.
Most of the time you will want to use the .get() method to access the first element and not a list. If you do want a list of all items, you can use .getlist().
I was getting the first element of a array(named 'search_strings'). Passing search_strings = ['V','F','X'] and req.form.get('search_strings') would only retrieve 'V'.
Had to use
Being passed as:![image](https://user-images.githubusercontent.com/66641667/221484387-d1c669f3-376a-4d3c-98e3-e6158d16356d.png)
Originally posted by @LucasGrasso in https://github.com/sanic-org/sanic/issues/288#issuecomment-1445742071