そのため、スタックオーバーフローの同じ屋根の下でほとんどの回答に基づいて修正を行いましたが、まだこの問題を解決できません。
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
問題が何であるかについての手がかりはありますか?
ありがとう!