识别手写文本API:202,但结果仍显示访问被拒绝

时间:2019-03-07 19:22:50

标签: azure api azure-cognitive-services

我能够同时使用Analyze Image和Describe Image API。但是,可识别的手写API给我带来了问题。我收到202接受的响应,但是当我从响应标头转到操作位置字段中提供的链接时,我看到此错误:

{"error":{"code":"Unspecified","message":"Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key."}}

我对所有3个API使用相同的密钥,为什么只有一个手写失败?我还尝试了提供的第二个备用密钥,它产生了相同的结果。我尝试发送带有实际笔迹的图像,该图像只是一个很好的例子。

工作:

curl --request POST \
  --url 'https://centralus.api.cognitive.microsoft.com/vision/v1.0/analyze?visualFeatures=Categories&details=Celebrities&language=en' \
  --header 'content-type: application/json' \
  --header 'ocp-apim-subscription-key: REDACTED' \
  --data '{"url":"https://picsum.photos/200"}'

不起作用:

curl --request POST \
  --url 'https://centralus.api.cognitive.microsoft.com/vision/v1.0/recognizeText?handwriting=true' \
  --header 'content-type: application/json' \
  --header 'ocp-apim-subscription-key: REDACTED' \
  --data '{"url":"https://picsum.photos/200"}'

问题响应:

Cache-Control: no-cache
Pragma: no-cache
Content-Length: 0
Expires: -1
Operation-Location: https://centralus.api.cognitive.microsoft.com/vision/v1.0/textOperations/128b2e59-d915-485d-ba7d-d163779ccad9
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
apim-request-id: 125c97dd-54d1-46b4-8cfc-ba778234f55c
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
Date: Thu, 07 Mar 2019 19:10:21 GMT

谢谢

0 个答案:

没有答案