public JsonResult Url([FromBody] ClassifyUrlRequestViewModel model) { try { var client = new VisualRecognitionClient(model.ApiKey); var response = client.FaceDetectionUrl(model.Url); return(Json(response)); } catch (Exception exc) { return(JsonError(exc)); } }
public JsonResult ClassifyUrl([FromBody] ClassifyUrlRequestViewModel model) { try { var client = new VisualRecognitionClient(model.ApiKey); var request = new VisualRecognitionClassifyUrl(model.Url) { Classifiers = model.Classifiers, Owners = model.Owners, Threshold = model.Threshold }; var response = client.ClassifyImageUrl(request); return(Json(response)); } catch (Exception exc) { return(JsonError(exc)); } }