获取access_token异常
黑面小男生 发布于2018-04 浏览:6058 回复:6
0
收藏
在使用获取 access_token方法的时候报这个异常: An unhandled exception of type 'System.AggregateException' occurred in mscorlib.dll,
怎么解?
收藏
点赞
0
个赞
共6条回复 最后由156******37回复于2022-07
#16用户已被禁言回复于2022-04

https://wenda.so.com/search/?ie=utf-8&q=%E8%80%81%E8%A1%97%E7%9A%87%E5%AE%B6%E5%88%A9%E5%8D%8E%E5%A8%B1%E4%B9%90%E6%8E%A5%E9%80%81%E7%94%B5%E8%AF%9D%E3%80%90%E5%AE%98%E7%BD%91%E2%86%92B2024.CN%E3%80%91%E6%B9%98%E6%BD%AD%E7%94%B5%E5%8F%B0%EF%BC%A2%EF%BC%AE&src=tab_video https://b2b.baidu.com/s?fr=wwwt&q=%E6%96%B0%E7%99%BE%E8%83%9C%E5%A8%B1%E4%B9%90%E8%B4%B5%E5%AE%BE%E5%8E%85%E5%AE%98%E6%96%B9%E7%BD%91%E5%9D%80TL262%C2%B7%EF%BC%A3%EF%BC%AF%EF%BC%AD%E8%A5%84%E6%A8%8A%E6%AF%95%E4%B8%9A%E7%94%9F%EF%BC%BE https://b2b.baidu.com/s?fr=wwwt&q=%E6%B2%B3%E5%8D%97%E6%96%B0%E5%AF%86%E5%93%AA%E9%87%8C%E8%83%BD%E7%8E%A9%E5%BA%84%E5%92%8C%E9%97%B2%E6%B8%B8%E6%88%8F%E7%BD%91%E5%9D%80B2024%C2%B7CN%E5%AE%A3%E5%9F%8E%E6%AF%95%E4%B8%9A%E7%94%9F%EF%BD%91%EF%BC%AB https://s.co188.com/front/forum?keyword=%F6%CE%B0%D9%C0%FB%D3%E9%C0%D6%C6%BD%CC%A8%CD%F8%D6%B7%A1%BEB2024.CN%BB%B6%D3%AD%C4%FA%A1%BF%C9%CF%C8%C4%D1%A7%B8%AE%A3%AA%A3%C6%A3%FC&fid=2343&catalog_name=&order_type=0&publish_time=0&reply_num=0&s_phrase=false https://search.instrument.com.cn/w/search?act=bid&keywords=%E7%BC%85%E7%94%B8%E6%9C%89%E6%96%B0%E6%B8%AF%E9%83%BD%E8%B5%8C%E5%9C%BA%E5%AE%98%E7%BD%91TL262%C2%B7C%EF%BC%AFM%E6%B2%B3%E6%B1%A0%E7%94%9F%E6%B4%BB%EF%BC%B6 https://www.rndsystems.com/cn/search?keywords=%E6%B5%99%E6%B1%9F%E6%B8%A9%E5%B2%AD%E5%93%AA%E6%9C%89%E7%BD%91%E4%B8%8A%E5%B9%B3%E5%8F%B0%E7%9B%B4%E8%90%A5%E7%BD%91TL262%C2%B7C%EF%BC%AFM%E6%8B%89%E8%90%A8%E6%AF%95%E4%B8%9A%E7%94%9F%EF%BC%98%EF%BC%B0%EF%BC%A9

0
#6hefeitest回复于2018-10

我用c#没遇到你的问题,复制粘贴过来就可以用了

0
#5用户已被禁言回复于2018-04
#4 黑面小男生回复
您好,我用的是 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;
展开

http://ai.baidu.com/forum/user/center/2312565 你可以咨询C#大神

0
#4黑面小男生回复于2018-04
#2 用户已被禁言回复
这是啥语言调用呢?一般接口都会返回json格式的字符串

您好,我用的是 c# 的调用,以下是 C# 的 API 文档中的调用代码,测试的时候会在红色字体的地方报这个异常

String authHost = "https://aip.baidubce.com/oauth/2.0/token";
HttpClient client = new HttpClient();
List> paraList = new List>();
paraList.Add(new KeyValuePair("grant_type", "client_credentials"));
paraList.Add(new KeyValuePair("client_id", clientId));
paraList.Add(new KeyValuePair("client_secret", clientSecret));

HttpResponseMessage response = client.PostAsync(authHost, new FormUrlEncodedContent(paraList)).Result;
result = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(result);
return result;

0
#3黑面小男生回复于2018-04

您好,我用的是 c# 的调用,以下是 C# 的 API 文档中的调用代码,测试的时候会在红色字体的地方报这个异常

String authHost = "https://aip.baidubce.com/oauth/2.0/token";
HttpClient client = new HttpClient();
List> paraList = new List>();
paraList.Add(new KeyValuePair("grant_type", "client_credentials"));
paraList.Add(new KeyValuePair("client_id", clientId));
paraList.Add(new KeyValuePair("client_secret", clientSecret));

HttpResponseMessage response = client.PostAsync(authHost, new FormUrlEncodedContent(paraList)).Result;
result = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(result);
return result;

0
#2用户已被禁言回复于2018-04

这是啥语言调用呢?一般接口都会返回json格式的字符串

1
TOP
切换版块