Call to https://accounts.spotify.com/api/token no longer working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Plan
Premium
Country
United States
My Question or Issue
Using the following code:
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes($"{clientId}:{clientSecret}")));
var formData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" }
};
var response = await client.PostAsync("https://accounts.spotify.com/api/token", new FormUrlEncodedContent(formData)); // FAILS HERE
var content = await response.Content.ReadAsStringAsync();
I can no longer get an access token to make other API calls... This just stopped working out of nowhere with no code changes, and the application just stops when it tries to execute the marked point in the code. I also attempted to wrap that part of the code in a try/catch and still no helpful exceptions (I assume due to the async nature?)... Any thoughts? I was running different versions of my code back and forth to try and figure out why one version was working and one wasn't, but then when the version that had been working this whole time stopped working... Started to scratch my head. Any thoughts?
Labels:
- Labels:
-
API access token
-
auth
-
Sporadic
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page