Created
July 13, 2024 03:47
-
-
Save schrobby/cafc66ba99fbb74a4280d7685a162af8 to your computer and use it in GitHub Desktop.
Told you, Dagger.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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