Search code examples
jsonapiface-detectionazure-cognitive-services

microsoft cognitive - face detect - upload image from local


I'm new with Face Recognition. I've seen a lot of question but I think I didn't found an answer yet.

I've understood that to upload an image from Web I have to use Content-Type application/json and then I have to put the image url in JSON field, like below.

{
"url":"http://example.com/1.jpg"
}

But, if I would upload an image from local, i should use Content-Type application/octet-stream. Now, my question is: what do I have to insert in JSON field in this case?

Sorry for my poor english and thanks in advance for your answers.

p.s. here you can find the tutorial I was following: https://westcentralus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236/console


Solution

  • This has been answered before.

    Basically the body should be the raw bits of the image.