Skip to content

Instantly share code, notes, and snippets.

@schrobby
Created July 13, 2024 03:47
Show Gist options
  • Save schrobby/cafc66ba99fbb74a4280d7685a162af8 to your computer and use it in GitHub Desktop.
Save schrobby/cafc66ba99fbb74a4280d7685a162af8 to your computer and use it in GitHub Desktop.
Told you, Dagger.
private void AddSongToQueue(string trackUri)
{
if (string.IsNullOrEmpty(accessToken))
{
GD.Print("Access token not available. Authenticate.");
return;
}
var queueUrl = $"https://api.spotify.com/v1/me/player/queue?uri={Uri.EscapeDataString(trackUri)}";
var headers = new[]
{
$"Authorization: Bearer {accessToken}",
"Content-Length: 0"
};
httpRequest.Request(queueUrl, headers, HttpClient.Method.Post);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment