连接到Rev API Net Core

问题描述

我在发布到API时遇到问题。发送Httpclient请求中的文本项。我遇到的问题是当我将链接发送到API(requestBody.media_url)时。此链接必须是公共网址。我曾经使用ngrok将文件夹公开为公用文件夹(在wwwroot中)。然后,外部API无法从该文件夹下载文件。 外部api是Rev.Ai

public async Task<ResponseBody> SendAudio()
        {
            RequestBody requestBody = new RequestBody();
            //requestBody.media_url = string.Format("https://xxxx.ngrok.io/Audios/09b69907-b863-4587-be19-fe98301179b8.mp3");
            //requestBody.media_url = string.Format("https://drive.google.com/file/d/xxx/view?usp=sharing");
            requestBody.media_url = string.Format("https://drive.google.com/file/d/xxx/view?usp=sharing");
            requestBody.skip_diarization = "false";
            requestBody.skip_punctuation = "false";
            requestBody.remove_disfluencies = "false";
            requestBody.filter_profanity = "false";
            requestBody.speaker_channels_count = null;
            requestBody.delete_after_seconds = "2592000";
            requestBody.custom_vocabularies = "";
            requestBody.Metadata = "sample Metadata";

            var stringContent = new StringContent(JsonConvert.SerializeObject(requestBody),Encoding.UTF8,"application/json");
            client.DefaultRequestHeaders.Authorization = GetAuthenticationHeader();
            var response = await client.PostAsync(urlPath,stringContent);
            var temp = await response.Content.ReadAsstringAsync();
            return JsonConvert.DeserializeObject<ResponseBody>(temp);
        }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)