The urllib.urlencode function expects a sequence of key-value pairs or a display type, for example, dict :
>>> urllib.urlencode([('a','1'), ('b','2'), ('b', '3')]) 'a=1&b=2&b=3'
To perform an HTTP POST POST, you must leave the SM_TEMPLATE BLOB template as set and set it as the POST body, and then add a Content-Type header to encode and encode the POST body. For instance:
data = SM_TEMPLATE headers = { 'Content-Type': 'application/soap+xml; charset=utf-8' } req = urllib2.Request(site, data, headers)
source share