Is there any other elegant way to add header to requests :
import requests
requests.get(url,headers={'Authorization', 'GoogleLogin auth=%s' % authorization_token})
doesn't work, while urllib2 worked :
import urllib2
request = urllib2.Request('http://maps.google.com/maps/feeds/maps/default/full')
request.add_header('Authorization', 'GoogleLogin auth=%s' % authorization_token)
urllib2.urlopen(request).read()
You can pass dictionary through
headers
keyword. This is very elegant in Python :-)