public CreateGetRequest ( string relativeUrl, string rootDomain, List |
||
relativeUrl | string | |
rootDomain | string | |
addedArguments | List |
|
useHttps | bool | |
Результат | string |
/// <summary> /// Get the list of shards synchronously. /// </summary> /// <returns>A list of shards.</returns> public List <Shard> GetShards() { var json = requester.CreateGetRequest(StatusRootUrl, RootDomain, null, false); return(JsonConvert.DeserializeObject <List <Shard> >(json)); }
/// <summary> /// Get a list of all champions synchronously. /// </summary> /// <param name="region">Region from which to retrieve the data.</param> /// <param name="championData">Data to retrieve.</param> /// <param name="language">Language of the data to be retrieved.</param> /// <returns>A ChampionListStatic object containing all champions.</returns> public ChampionListStatic GetChampions(Region region, ChampionData championData = ChampionData.none, Language language = Language.en_US) { var wrapper = cache.Get <string, ChampionListStaticWrapper>(ChampionsCacheKey); if (wrapper == null || language != wrapper.Language || championData != wrapper.ChampionData) { var json = requester.CreateGetRequest( string.Format(ChampionRootUrl, region.ToString()), RootDomain, new List <string> { string.Format("locale={0}", language.ToString()), championData == ChampionData.none ? string.Empty : string.Format("champData={0}", championData.ToString()) }); var champs = JsonConvert.DeserializeObject <ChampionListStatic>(json); wrapper = new ChampionListStaticWrapper(champs, language, championData); cache.Add(ChampionsCacheKey, wrapper, DefaultSlidingExpiry); } return(wrapper.ChampionListStatic); }