I am trying to use urllib.urlencode to post a multidimensional dictionary to a php page.
This is the code I am using
Expand|Select|Wrap|Line Numbers
- test = {}
- test['boom'] = {}
- test['boom']['zoom'] = "bang"
- server_params = urllib.urlencode(test)
- response = urllib2.urlopen(server_url, server_params).read()
Expand|Select|Wrap|Line Numbers
- Array
- (
- [boom] => {\'zoom\': \'bang\'}
- )
Is there a way to preserve the entire structure of the dictionary?
Thanks!