I’m trying to connect to Face Api (Microsoft Azure), but I’m getting problems to send post request.
This is my code:
const uriBase = 'https://westcentralus.api.cognitive.microsoft.com/face/v1.0';
const imageUrl = 'https://i.ytimg.com/vi/XuJwETp1axs/maxresdefault.jpg';
let body = new FormData();
body.append('url', imageUrl);
const params = new HttpParams()
.set('returnFaceId', 'true')
.set('returnFaceLandmarks', 'false')
.set('returnFaceAttributes', 'age,gender,headPose,smile,facialHair,glasses,' +
'emotion,hair,makeup,occlusion,accessories,blur,exposure,noise' );
this.http.post(uriBase, {'url': imageUrl},
{headers: {
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key' : subscriptionKey}, params: params})
.subscribe(
res => {
console.log(res);
},
(err: HttpErrorResponse) => {
console.log(err.error);
console.log(err.name);
console.log(err.message);
console.log(err.status);
}
);
But I’m getting this error from console:
error: Object { code: "ResourceNotFound", message: "The requested resource was not found."}
Can anyone help me, please ?