So, I ve made corrections based on most of the answers under the same roof in stack overflow, I'm still unable to resolve this problem.
queryBingFor = "Google Fibre"
quoted_query = urllib.quote(queryBingFor)
account_key = "dslfkslkdfhsehwekhrwkj2187iwekjfkwej3"
rootURL = "https://api.datamarket.azure.com/Bing/Search/v1/"
searchURL = rootURL + "Image?format=json&Query=" + quoted_query
cred = base64.encodestring(accountKey)
reqBing = urllib2.Request(url=searchURL)
author = "Basic %s" % cred
reqBing.add_header('Authorization',author)
readURL = urllib2.urlopen(reqBing)
I know I'm missing out something in the above code, that gives me a:
urllib2.HTTPError: HTTP Error 401: The authorization type you provided is not supported. Only Basic and OAuth are supported
Any clue on what the problem could be?
Thanks!