In my Android app the user takes a photo via camera. It is then available as bitmap:
Bitmap photo = (Bitmap) data.getExtras().get("data");
This I want to send to Azure Face-detect API via http post. Currently I get it only to work with a given URL to a pic:
StringEntity reqEntity = new StringEntity("{\"url\":\"https://upload.wikimedia.org/wikipedia/commons/c/c3/RH_Louise_Lillian_Gish.jpg\"}");
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(request)
How to use the Bitmap photo to send it to azure?
According to the API reference of Azure Face Detect, you can use the API with
application/octet-stream
content type to pass the android bitmap as binary data.As reference, here is my sample code.
Hope it helps.