mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
Merge pull request #21 from johtso/nonflat-formdata
Put multiple form data values with same key into lists
This commit is contained in:
@@ -85,6 +85,13 @@ def get_dict(*keys, **extras):
|
||||
if not form.values().pop():
|
||||
data = form.keys().pop()
|
||||
form = None
|
||||
|
||||
if form:
|
||||
nonflat_dict = form.to_dict(flat=False)
|
||||
for k, v in nonflat_dict.items():
|
||||
if len(v) == 1:
|
||||
nonflat_dict[k] = v[0]
|
||||
form = nonflat_dict
|
||||
|
||||
d = dict(
|
||||
url=request.url,
|
||||
|
||||
Reference in New Issue
Block a user