Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Flurl;
- using Flurl.Http;
- using Newtonsoft.Json;
- using Newtonsoft.Json.Linq;
- byte[] image = ImagePro.GetImageAsByteArray(txtIdentifyImagePath.Text);
- ByteArrayContent content = new ByteArrayContent(image);
- List<dynamic> response = Settings.UriBase
- .AppendPathSegment("detect")
- .SetQueryParams(new
- {
- returnFaceId = "true"
- })
- .WithHeader("Ocp-Apim-Subscription-Key", Settings.SubscriptionKey)
- .WithHeader("Content-Type", "application/octet-stream")
- .PostAsync(content)
- .ReceiveJson<List<dynamic>>()
- .Result;
- foreach (var item in response)
- {
- txtIdentify.AppendText(((JObject)item).ToString() + Environment.NewLine);
- txtIdentify.AppendText("---------------" + Environment.NewLine);
- }
- SubscriptionKey-14359e73027d412b96806b7ebf50dabc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement