0
WebClient client = new WebClient();
string json_response = client.DownloadString("https://tr.api.pvp.net/api/lol/tr/v1.4/summoner/by-name/SUMMONERNAME?api_key=KEY");
dynamic deserialized_response = JsonConvert.DeserializeObject<dynamic>(json_response);
string Summonerid = deserialized_response.id;
嗨,我只是想調用唯一的ID,但即時通訊失敗。我也試圖用viewmodel做到這一點,但我仍然失敗了。我也想做一個變量SUMMONERNAME我怎麼能有一個文本框輸入SUMMONERNAME。 這是API的參照鏈接 「https://developer.riotgames.com/api/methods#!/1079/3722」Riot http api調用.NET MVC
string json_response = client.DownloadString("https://tr.api.pvp.net/api/lol/tr/v1.4/summoner/by-name/SUMMONERNAME?api_key=KEY");
RiotApiViewModel deserialized_response = JsonConvert.DeserializeObject<RiotApiViewModel>(json_response);
long id = deserialized_response.id;