认知计算机视觉 api,来自 api 调用的初始 202 响应,然后来自 Operation-Location 的 401 错误

cognitive computer vision api, Initial 202 response from api call, then 401 error from Operation-Location

运行 这是一个 reactjs 项目,这是我当前的代码:

         let response = await fetch('https://apis-cv.cognitiveservices.azure.com/vision/v1.0/recognizeText?handwriting=true', {
          method: 'POST',
          headers: { 'Content-Type': 'application/octet-stream', 'Ocp-Apim-Subscription-Key': '<MY KEY HERE>' },
          body: this.makeblob(event.target.result)
        });
        console.log(response);

我的初始响应状态为 202:给出了操作位置。 (即 https://apis-cv.cognitiveservices.azure.com/vision/v1.0/textOperations/a60b86b2-bf85-4e3b-8beb-65dc075e81d7 ) 但是 Operation-Location 导致 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 和内容类型:application/json 并得到相同的结果。

错误消息非常清楚:当您尝试获取 TextOperations 的结果时,您忘记在第二个查询中添加 'Ocp-Apim-Subscription-Key'。

你能添加你如何尝试获得结果的实现吗?