I am trying to get saved tracks from Spotify, what am I doing wrong?
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
HttpResponseMessage resp = await client.GetAsync("https://api.spotify.com/v1/me/tracks");
string responseBody = await resp.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
This is a request sample from the documentation:
curl --request GET
--url https://api.spotify.com/v1/me/tracks
--header 'Authorization: '
--header 'Content-Type: application/json'