public async Task <ImageRecognitionResponse> SendAsync(ImageRecognitionRequest request) { var uri = new Uri($"{_imageRecognitionOptions.Url}?details={string.Join(",", request.Details)}&visualFeatures={string.Join(",", request.VisualFeatures)}"); var response = await _restClient.PostAsync <byte[], ImageRecognitionResponse>(uri, request.Image); return(response); }
/// <summary> /// 传入照片和身份信息,判断该照片与公安权威库的证件照是否属于同一个人。 /// </summary> /// <param name="req"><see cref="ImageRecognitionRequest"/></param> /// <returns><see cref="ImageRecognitionResponse"/></returns> public ImageRecognitionResponse ImageRecognitionSync(ImageRecognitionRequest req) { JsonResponseModel <ImageRecognitionResponse> rsp = null; try { var strResp = this.InternalRequestSync(req, "ImageRecognition"); rsp = JsonConvert.DeserializeObject <JsonResponseModel <ImageRecognitionResponse> >(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return(rsp.Response); }