title: urllib's urlencode returning weird encoded results
body: <p>I'm trying to use Facebook's REST api, and am encoding a JSON string/dictionary using <a href="http://docs.python.org/library/urllib.html#urllib.urlencode" rel="nofollow"><code>urllib.urlencode</code></a>. The result I get however, is different from the correct encoded result (as displayed by pasting the dictionary in the attachment field here <a href="http://developers.facebook.com/docs/reference/rest/stream.publish/" rel="nofollow">http://developers.facebook.com/docs/reference/rest/stream.publish/</a>). I was wondering if anyone could offer any help.</p>
  
  <p>Thanks.</p>
  
  <p>EDIT:</p>
  
  <p>I'm trying to encode the following dictionary:</p>
  
  <pre><code>{"media": [{"type":"flash", "swfsrc":"http://shopperspoll.webfactional.com/media/flashFile.swf", "height": '100', "width": '100', "expanded_width":"160", "expanded_height":"120", "imgsrc":"http://shopperspoll.webfactional.com/media/laptop1.jpg"}]}
  </code></pre>
  
  <p>This is the encoded string using urllib.urlencode:</p>
  
  <p><code>"media=%5B%7B%27swfsrc%27%3A+%27http%3A%2F%2Fshopperspoll.webfactional.com%2Fmedia%2FflashFile.swf%27%2C+%27height%27%3A+%27100%27%2C+%27width%27%3A+%27100%27%2C+%27expanded_width%27%3A+%27160%27%2C+%27imgsrc%27%3A+%27http%3A%2F%2Fshopperspoll.webfactional.com%2Fmedia%2Flaptop1.jpg%27%2C+%27expanded_height%27%3A+%27120%27%2C+%27type%27%3A+%27flash%27%7D%5D</code>"</p>
  
  <p>It's not letting me copy the result being thrown out from the facebook rest documentation link, but on copying the above dictionary in the attachment field, the result is different.</p>