コード例 #1
0
        public HttpClient GetDefaultClient()
        {
            var authHandler = new SpotifyAuthClientCredentialsHttpMessageHandler(
                ClientId,
                ClientSecret,
                new HttpClientHandler());

            var client = new HttpClient(authHandler)
            {
                BaseAddress = new Uri(BaseUrl)
            };

            var token = authHandler.GetAuthenticationTokenAsync();


            return(client);
        }
コード例 #2
0
        public Task <string> GetToken(SpotifyAuthClientCredentialsHttpMessageHandler authHandler)
        {
            var token = authHandler.GetAuthenticationTokenAsync();

            return(token);
        }