I\'m trying to send data to Microsoft Cognitive Services\' Emotion API, in the form of Content-Type: application/octet-stream
.
I\'m getting the Base64 strin
I was doing a very silly thing here. The API Documentation of the Emotion API here says that it needs data as binary image data.
But I was still giving it as JSON. I simply changed the implementation of getUserEmotion
method. Instead of
return this.http.post(this.apiUrl, { "data": this.makeBlob(userImageBlob) }, { headers: headers });
I used this
return this.http.post(this.apiUrl, this.makeBlob(userImageBlob), { headers: headers });
Hope this helps someone who's facing the same issue!