Decoding POST Pyramid Data (MultiDict Object)

I get a POST request with data formatted as a MultiDict object. Where can I find documentation about this data structure? and what is the best method (library) for decoding this data into a dictionary object (with lists and dictionaries inside)

I found this in urllib3 but not sure what it is. preferred method.

I already wrote most of the code to fit this data style, so I don’t really hope to change the way we send data from the HTML form itself.

thanks

+4
source share
2 answers

MultiDict is part of the WebOb project , see the MultiDict documentation .

A MultiDict acts basically like a python dictionary, except that you can explicitly query a single value or list of values ​​using the .getone() and .getall() methods.

.mixed() returns a dictionary with unit and list values ​​needed to represent each key.

+8
source

Updated link to doc: Webob MultiDict

You probably want mixed() or dict_of_lists() .

0
source

All Articles