4
所以,我已经做出基于大多数堆栈溢出在同一屋檐下的答案更正,我仍然无法解决此问题。urllib2.HTTPError:HTTP 401错误,而使用新的API兵(在蔚蓝的市场)查询
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)
我知道我错过了在上面的代码什么的,这给了我一个:对这个问题可能是什么
urllib2.HTTPError: HTTP Error 401: The authorization type you provided is not supported. Only Basic and OAuth are supported
任何线索?
谢谢!
用户名变量代表什么? – varagrawal 2015-03-14 16:30:11