Riot http api call .NET MVC


        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,但我失败了。我也试图用视图模型做到这一点,但我仍然失败了。我也想做一个变量SUMMONERNAME我怎么能有一个文本框输入到SUMMONERNAME。这是api的参考链接"https://developer.riotgames.com/api/methods#!"/1079/3722 "

        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;

var foundSummoner = JsonConvert.DeserializeObject>(json_response);这是修复我的错误

相关内容

  • 没有找到相关文章

最新更新