コード例 #1
0
        public async Task <EpisodesByPodId> MoreEpbyPodIdAsync(string shoId, int offset)
        {
            var token = await GetToken();

            HttpClient client = new HttpClient();

            client.BaseAddress = new Uri("https://api.spotify.com/v1/");
            client.DefaultRequestHeaders.Add("Authorization", $"{token.token_type} {token.access_token}");
            var response = await client.GetAsync($"shows/{shoId}/episodes?&market=US&offset={offset}&limit=20");

            var jsonData = await response.Content.ReadAsStringAsync();

            EpisodesByPodId ro = JsonSerializer.Deserialize <EpisodesByPodId>(jsonData);

            return(ro);
        }
コード例 #2
0
        public async Task <EpisodesByPodId> SearchEpbyPodIdAsync(string shoId) // returns object that is model type: "EpisodesByPodId"
        {
            var token = await GetToken();

            HttpClient client = new HttpClient();

            client.BaseAddress = new Uri("https://api.spotify.com/v1/");
            client.DefaultRequestHeaders.Add("Authorization", $"{token.token_type} {token.access_token}");
            var response = await client.GetAsync($"shows/{shoId}/episodes?market=US");

            var jsonData = await response.Content.ReadAsStringAsync();

            EpisodesByPodId ebp = JsonSerializer.Deserialize <EpisodesByPodId>(jsonData);

            return(ebp);
        }