{"statusCode":401,"message":“由于缺少订阅密钥而拒绝访问.向API发出请求时,请确保包括订阅密钥. } [英] { "statusCode": 401, "message": "Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API." }

查看:829
本文介绍了{"statusCode":401,"message":“由于缺少订阅密钥而拒绝访问.向API发出请求时,请确保包括订阅密钥. }的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个API管理资源.但是当我尝试使用API​​管理门户访问API时.

I have created an API management resource. but when i try to access API using API management portal.

它.给我下面的答复.

Content-Type: application/json { "statusCode": 500, "message": "Internal server error", "activityId": "95c38f1d-1f1d-4277-bdc2-53e634d09129" }

在这里,我也在请求中也传递了产品订阅密钥:

Here I am also passing the product subscription key as well in request:

请提出相同的建议

推荐答案

好像您已启用要求订阅产品设置的选项,请尝试通过 标题"Ocp-Apim-Subscription-Key",看看是否有帮助.如果您不需要订阅选项,请在产品设置中将其禁用.

Looks like you have enabled the option to Require subscription for the product settings, try to pass the header "Ocp-Apim-Subscription-Key" and see if it helps. If you don't want the subscription option, disable it in the product settings.

: 始终尝试将API添加到产品中,否则可能会出错.密钥应属于API包含的产品.

Note: Always try to add your API to your product, or you might get error. The key should belong to the product which the API includes.

此答案很有帮助,请单击标记为答案"或投票.要在您的论坛上提供其他反馈 体验,请单击

------------------------------------------------------------------------------------------------------If this answer was helpful, click "Mark as Answer" or Up-Vote. To provide additional feedback on your forum experience, click here


这篇关于{"statusCode":401,"message":“由于缺少订阅密钥而拒绝访问.向API发出请求时,请确保包括订阅密钥. }的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆