Accessing POST params with same name in python
I need to get v开发者_StackOverflow中文版alues of these check boxes with same name through HTTP "POST".
<input type="checkbox" id="dde" name="dept[]" value="dde"/>
<input type="checkbox" id="dre" name="dept[]" value="dre"/>
<input type="checkbox" id="iid" name="dept[]" value="iid"/>
How to get these values in python using self.request.get() method?
You can use request.get_all()
.
According to the docs it "Returns a list of values of all of the query (URL) or POST arguments with the given name, possibly an empty list."
精彩评论