Can't send ajax request

Pablo López 1 Reputation point
2022-04-12T13:21:43.73+00:00

I've tried to append header token like this:
Attempts:
headers.append('Authorization', 'Bearer '+this.apiToken);

headers.append('Authorization', this.apiToken);

headers.append('api-key', this.apiToken);

headers.append('Ocp-Apim-Subscription-Key', this.apiToken);

and still getting a 401.

I'm trying to reach CognitiveServices through https://myCluster.cognitiveservices.azure.com/ . I achieved it by postman, but in Angular it's impossible, even emulating the same requests.... What am I doing wrong?

BTW, I can't add more labels for a better indexing...

Thank you in advance

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.