I am trying to port the following curl call into a python script using urllib/urllib2 : curl -H "X-Api-Key: ccccccccccccccccccccccc" -H "X-Api-Secret: cbcwerwerwerwerwerwerweweewr9" https://api.assembla.com/v1/users/user.xml
I tried using the standard url call, but it failed:
url_assembla = 'https://api.assembla.com/v1/users/suer.xml'
base64string_assembla = base64.encodestring('%s:%s' % ('ccccccccccccccccccccccc','cbcwerwerwerwerwerwerweweewr9')).replace('\n', '')
req_assembla = urllib2.Request(url_assembla)
req_assembla.add_header("Authorization", "Basic %s" % base64string_assembla)
ET.parse(urllib2.urlopen(req_assembla))
Can any one advice on how to incorporate the Api-secret and Api-key. I want to do this as a script, so did not want to install the assembla package.
Thanks