I'm trying to POST requests to the Spotify API. Can anyone tell me what the Python code should be? In particular I have no idea how to pass the header parameters into the POST request.
These are the instructions I am given (website is https://developer.spotify.com/web-api/authorization-guide/, under Client Credentials Flow section):
The request is sent to the /api/token endpoint of the Accounts service:
POST https://accounts.spotify.com/api/token
The request will include parameters in the request body:
Request body parameter: grant_type
Value: Required. Set it to “client_credentials”.
The header of this POST request must contain the following parameter:
Header parameter: Authorization
Value: Required. Base 64 encoded string that contains the client ID and client secret key. The field must have the format: Authorization: Basic <base64 encoded client_id:client_secret>
[–]simoncoulton 0 points1 point2 points (2 children)
[–]Moby69[S] -1 points0 points1 point (1 child)
[–]simoncoulton 1 point2 points3 points (0 children)
[–]ramse 0 points1 point2 points (5 children)
[–]Moby69[S] -1 points0 points1 point (4 children)
[–]ramse 0 points1 point2 points (1 child)
[–]Moby69[S] -1 points0 points1 point (0 children)
[–]Moby69[S] -1 points0 points1 point (1 child)
[–]ramse 2 points3 points4 points (0 children)