title: urlencode a multidimensional dictionary in python
body: <p>How can I get a URL-encoded version of a multidimensional dictionary in Python? Unfortunately, <code>urllib.urlencode()</code> only works in a single dimension. I would need a version capable of recursively encoding the dictionary.</p>
  
  <p>For example, if I have the following dictionary:</p>
  
  <pre><code>{'a': 'b', 'c': {'d': 'e'}}
  </code></pre>
  
  <p>I want to obtain the following string:</p>
  
  <pre><code>a=b&amp;c[d]=e
  </code></pre>