开发者

Accessing POST params with same name in python

开发者 https://www.devze.com 2022-12-09 22:44 出处:网络
I need to get v开发者_StackOverflow中文版alues of these check boxes with same name through HTTP \"POST\".

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."

0

精彩评论

暂无评论...
验证码 换一张
取 消