What are the Ajax authorization headers for a Bing API request?

こ雲淡風輕ζ 提交于 2019-12-04 12:20:05

I figured it out. I had to Base64 encode my Azure key in the headers, prefixed by a colon. I went to this website and pasted a colon ":" plus my Azure account key and base64'd it.

So my key OQA/cs becomes :OQA/cs then base64'd into Ok9RQS9jcw== and the final header looks like

                `headers: {
                    'Authorization': 'Basic Ok9RQS9jcw=='
                 }`

and Bing returns the json I want. Do not forget to include the colon as the first character of your account key before you encode it so that you Base64 encode it as part of your key.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!