Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Server Error, HTTP Response 206: User Authentication Flow via Python

Server Error, HTTP Response 206: User Authentication Flow via Python

Reply
1 Reply

That request is getting a website; not a json object. The Authorization Code Flow is more complex than your code.

Also, the header should be: headers = {"Content-Type": "application/x-www-form-urlencoded"}.

Because it returns html code, and not json, .json() causes an error.

Just replace the header, remove .json(), try print out the response with print(code.text), and see it for yourself.

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Suggested posts

Staff
Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

Staff
ModeratorStaff / Moderator/ 3 years ago  in Social & Random

Type a product name