使用 Unity 访问 Bing News API v7 时出现错误 401
Error 401 when accessing Bing News API v7 using from Unity
我想使用 UnityEngine.Networking 和 StartCoroutine() 从 Bing API Unity/C# 中检索数据。我收到错误 401,它是:
{"error":{"code":"401","message": "Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource."}}
我尝试调用的 url 是:
https://[**MyEndpoint**]/bing/v7.0/news/trendingtopics?BingAPIs-Market=en-US&Ocp-Apim-Subscription-Key=[**KEY**]
我假设拒绝的原因是我在 url 中明确添加了 Ocp-Apim-Subscription-Key header 但不确定 %100.
我想使用 UnityEngine.Networking 和 StartCoroutine() 从 Bing API Unity/C# 中检索数据。我收到错误 401,它是:
{"error":{"code":"401","message": "Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource."}}
我尝试调用的 url 是:
https://[**MyEndpoint**]/bing/v7.0/news/trendingtopics?BingAPIs-Market=en-US&Ocp-Apim-Subscription-Key=[**KEY**]
我假设拒绝的原因是我在 url 中明确添加了 Ocp-Apim-Subscription-Key header 但不确定 %100.