private static void DistortionCorrect(String token, String endpoint) { // The obs url of file String dataUrl = ""; // Whether to correct distortion or not bool correction = false; // post data by native file String data = utils.ConvertFileToBase64("../../data/moderation-distortion.jpg"); String reslut = ModerationService.DistortionCorrectToken(token, data, dataUrl, correction, endpoint); JObject joResult = (JObject)JsonConvert.DeserializeObject(reslut); if (joResult["result"]["data"].ToString() != "") { String resultPath = @"../../data/moderation-distortion-token-1.bmp"; resultPath = utils.Base64ToFileAndSave(joResult["result"]["data"].ToString(), resultPath); Console.WriteLine(resultPath); } else { Console.WriteLine(reslut); } // The OBS link must match the region, and the OBS resources of different regions are not shared dataUrl = "https://sdk-obs-source-save.obs.cn-north-4.myhuaweicloud.com/modeation-distortion.jpg"; // post data by obs url reslut = ModerationService.DistortionCorrectToken(token, "", dataUrl, correction, endpoint); joResult = (JObject)JsonConvert.DeserializeObject(reslut); if (joResult["result"]["data"].ToString() != "") { String resultPath = @"../../data/moderation-distortion-token-2.bmp"; resultPath = utils.Base64ToFileAndSave(joResult["result"]["data"].ToString(), resultPath); Console.WriteLine(resultPath); } else { Console.WriteLine(reslut); } Console.ReadKey(); }