简体   繁体   中英

Response Status: Unauthorized

I would like to test the face Rest interfane from java. The purpose is to se if any faces is found in an jpg image. The res call I uses for this is../face/v1.0/detect

I am setting the Ocp-Apim-Subscription-Key header to XXXX (edit: hidden by moderation)

But the answer is Response Status: Unauthorized

Where do I find the correct Ocp-Apim-Subscription-Key header in the påortal?

/Peter

Prenumerations-ID d97c5756-0c7b-48bf-b511-620078498063 Katalog Default Directory (peterivarsson......onmicrosoft.com)

If you correctly set your "Ocp-Api-Subscription-Key" and you got a 401 Unauthorized reply, it is probably because your endpoint is not correct.

Generally, it's the case when people use a wrong region for their endpoint: each subscription key is linked to a region, it's not global.

Or double check the value of your key in your Azure resource if the endpoint is correct.

If you are unsure of your code implementation, use the console tester in the API documentation by taking a simple GET method: choose the correct region in it, just paste your key and there you go https://westeurope.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395248

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM