Saturday, 18 April 2020

What is wrong with my headers or request body on this POST request?

I am using the Spotify API with Node.js to create a playlist for the user but it is not going through and it returns no errors. All of my callback functions run with the same auth token. Here is the request:request.post({ url: 'https://api.spotify.com/v1/users/'+body.id+'/playlists', headers: { 'Authorization': 'Bearer ' + access_token, 'Content-Type' : 'application/json'}, data:{ "name": "Disco Refresh" }, json: true }, I have a GET request in the callback function for this request that runs fine. Here is the endpoint I am using. Also I logged body.id and it contains the user's id.

Submitted April 18, 2020 at 05:58PM by TheSlothJesus

No comments:

Post a Comment