python REST API access fails after adding date to URL

mahsan9861 at gmail.com mahsan9861 at gmail.com
Tue Sep 10 11:44:41 EDT 2013


Found a solution. For query string you have to add it to both the http_headers dictionary AND to the URL when making the Request. 

old line:
http_headers = {} 
http_headers['oauth_version'] = '1.0' 

new line:
http_headers = {} 
http_headers['date'] = 'ddmmyyyy' #add this line 
http_headers['oauth_version'] = '1.0' 

old line:
req = urllib2.Request(base_url) 

new line:
req = urllib2.Request(base_url + '?date=ddmmyyyy') 

Everything else remains the same.



More information about the Python-list mailing list