title: how to create an associative array in the query string
body: <p>I'm using requests lib and python 2.7
  When doing this :</p>
  
  <pre><code>import requests
  
  uri_params = {
      u'email': u'myEmail@domain.com',
      u'id_user': 15,
      u'user_var': {
          u'var1': u'val1',
          u'var2': u'val2',
      }
  }
  
  r = requests.get('http://google.com/',  params=uri_params)
  print r.url
  </code></pre>
  
  <p>it gives me as a result :
  <a href="http://www.google.com/?id_user=15&amp;email=myEmail%40domain.com&amp;user_var=var1&amp;user_var=var2" rel="nofollow">http://www.google.com/?id_user=15&amp;email=myEmail%40domain.com&amp;user_var=var1&amp;user_var=var2</a></p>
  
  <p>instead of
  <a href="http://www.google.com/?id_user=15&amp;email=myEmail%40domain.com&amp;user_var%5Bvar1%5D=val1&amp;user_var%5Bvar2%5D=val2" rel="nofollow">http://www.google.com/?id_user=15&amp;email=myEmail%40domain.com&amp;user_var%5Bvar1%5D=val1&amp;user_var%5Bvar2%5D=val2</a>
   (= user_var[var1]=val1&amp;user_var[var2]=val2)</p>
  
  <p>Do you know if the requests lib as a method to handle this ?</p>
  
  <p><strong>EDIT</strong> :
  It took me few minutes too understand how to use Martijn Pieters's code.
  So here is the the final code for other people new to python like me :</p>
  
  <pre><code>import requests
  import urllib
  
  def nested_object(name, mapping):
      return [(u'{}[{}]'.format(name, key), value) for key, value in mapping.iteritems()]
  
  uri_params = [
      (u'email', u'myEmail@domain.com'),
      (u'id_user', 15),
  ]
  
  uri_params.extend(nested_object(u'user_var', {u'var1': u'val1', u'var2': u'val2'}))
  encoded = urllib.urlencode(uri_params)
  
  r = requests.get('http://google.com/',  params=encoded)
  print r.url
  </code></pre>