首页 版块 访问AI主站 注册 发帖
黑面小男生
24
积分 积分商城
0
获赞
遠端伺服器傳回一個錯誤: (407) 必須 Pr
Ta的回复 :新人小白  求大神帮忙
2
获取access_token异常
Ta的回复 :您好,我用的是 c# 的调用,以下是 C# 的 API 文档中的调用代码,测试的时候会在红色字体的地方报这个异常 String authHost = "https://aip.baidubce.com/oauth/2.0/token"; HttpClient client = new HttpClient(); List<KeyValuePair<String, String>> paraList = new List<KeyValuePair<string, string>>(); paraList.Add(new KeyValuePair<string, string>("grant_type", "client_credentials")); paraList.Add(new KeyValuePair<string, string>("client_id", clientId)); paraList.Add(new KeyValuePair<string, string>("client_secret", clientSecret)); HttpResponseMessage response = client.PostAsync(authHost, new FormUrlEncodedContent(paraList)).Result; result = response.Content.ReadAsStringAsync().Result; Console.WriteLine(result); return result;
7
获取access_token异常
Ta的回复 :您好,我用的是 c# 的调用,以下是 C# 的 API 文档中的调用代码,测试的时候会在红色字体的地方报这个异常 String authHost = "https://aip.baidubce.com/oauth/2.0/token"; HttpClient client = new HttpClient(); List<KeyValuePair<String, String>> paraList = new List<KeyValuePair<string, string>>(); paraList.Add(new KeyValuePair<string, string>("grant_type", "client_credentials")); paraList.Add(new KeyValuePair<string, string>("client_id", clientId)); paraList.Add(new KeyValuePair<string, string>("client_secret", clientSecret)); HttpResponseMessage response = client.PostAsync(authHost, new FormUrlEncodedContent(paraList)).Result; result = response.Content.ReadAsStringAsync().Result; Console.WriteLine(result); return result;
7
切换版块
智能客服