public async Task<League> RetrieveChallengerLeague(CreepScore.Region region, GameConstants.Queue queue) { Url url = UrlConstants.UrlBuilder(region, UrlConstants.leagueAPIVersion, UrlConstants.leaguePart).AppendPathSegment("challenger"); url.SetQueryParams(new { type = GameConstants.GetQueue(queue), api_key = apiKey }); Uri uri = new Uri(url.ToString()); await GetPermission(region); string responseString = await GetWebData(uri); if (GoodStatusCode(responseString)) { return LoadLeague(JObject.Parse(responseString)); } else { errorString = responseString; return null; } }
public async Task<League> RetrieveChallengerLeague(CreepScore.Region region, GameConstants.Queue queue) { Uri uri; uri = new Uri(UrlConstants.GetBaseUrl(region) + "/" + UrlConstants.GetRegion(region) + UrlConstants.leagueAPIVersion + UrlConstants.leaguePart + "/challenger?type=" + GameConstants.GetQueue(queue) + UrlConstants.andApiKeyPart + apiKey); string responseString = await GetWebData(uri); if (GoodStatusCode(responseString)) { return LoadLeague(JObject.Parse(responseString)); } else { errorString = responseString; return null; } }