使用C#获取LOL即将到来的赛事(含GameID)遇问题求助
求助:调用PandaScore API获取LOL未来赛事持续报错
我需要获取LOL的未来赛事数据(最好包含GameID),试过Riotsharp等多个API,目前只有PandaScore的接口适配需求,但无论怎么修改官网示例代码的参数,调用后总是收到错误信息。有没有使用过PandaScore或者遇到类似问题的朋友能帮忙解决?
官方提供的示例代码如下:
using System.Net.Http.Headers; var client = new HttpClient(); var request = new HttpRequestMessage { Method = HttpMethod.Get, RequestUri = new Uri("https://api.pandascore.co/lol/matches/upcoming?sort=&page=1&per_page=50"), Headers = { { "accept", "application/json" }, { "authorization", "Bearer /*我的API密钥,在PandaScore官网生成*/" }, }, }; using (var response = await client.SendAsync(request)) { response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body); }
内容的提问来源于stack exchange,提问作者Samsuel
相关产品推荐
相关产品推荐

