针对Speech API的JS API Ocp-Apim-Subscription-Key问题 [英] JS API Ocp-Apim-Subscription-Key issue for Speech API

查看:527
本文介绍了针对Speech API的JS API Ocp-Apim-Subscription-Key问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我正在尝试访问我的Ocp-Apim-Subscription-Key,如下所述 - https://dev.projectoxford.ai/docs/services/54ef13cc3d8a4b06cc921a4a / operations / 5518fde849c3f71a94aaf9d9但该链接显示"无法访问您的订阅"的类型。错误
。当我登录到我的Oxford AI帐户并转到订阅部分时,我看不到Ocp-Apim-Subscription-Key - 仅主键和辅助键,当作为Ocp-Apim-Subscription-Key标头值的值提供时,返回以下错误:

I am trying to access my Ocp-Apim-Subscription-Key as described here - https://dev.projectoxford.ai/docs/services/54ef13cc3d8a4b06cc921a4a/operations/5518fde849c3f71a94aaf9d9 but the link displays kind of "can't access your subscription " error . When I sign in into my Oxford AI account and go to the subscription section, I see no Ocp-Apim-Subscription-Key - only Primary and Secondary keys which, when provided as values for Ocp-Apim-Subscription-Key header value, return the following error:

" 由于订阅密钥无效而拒绝访问。确保为有效订阅提供有效密钥 "

"Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription"

问题发生的有趣点仅在使用JS API时。取自Oxford Project git帐户的python脚本在它发送的HTTP请求中不使用Ocp-Apim-Subscription-Key标头 - 它仅使用主键作为多部分有效负载中的client_secret
值它工作得很好。我已经尝试从JS脚本发送没有该标头的HTTP请求,但它返回相同的"无效的子服务"。错误。

The interesting point that the problem occurs only when using JS API. The python script, taken from the Oxford Project git account makes no use of the Ocp-Apim-Subscription-Key header in the HTTP request it sends - it uses only primary key as the client_secret value in the multi-part payload and it works just fine. I've tried to send the HTTP request without that header as well from the JS script, but it returns the same "invalid subsription" error.

请协助

推荐答案

刚试过同一个API参考页面中的curl API,又名D:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\语音/ V0 / internalIssueToken" -H"Content-Type:application / json" -H"Ocp-Apim-Subscription-Key:
{

Just tried the curl API from the same API Reference page, aka D:\Stuff\curl_X64_ssl\winssl\curl.exe -v -X POST "https://api.projectoxford.ai/speech/v0/internalIssueToken" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: {


my_primary_subscription_key}" --data-ascii" 12345"
my_primary_subscription_key}" --data-ascii "12345"

作为响应得到了服务器端崩溃的整个堆栈占用空间。同样的情况发生在"Open API Testing Console"上。

As a response got the whole stack footprint of a crash on the server side. The same happens on the "Open API Testing Console"


这篇关于针对Speech API的JS API Ocp-Apim-Subscription-Key问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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