简体   繁体   中英

HTTP Request Code 206 Spotify Server Error

I am trying to get the user authorization code for the authentication flow. When sending the get request with Python and requests I have two dictionaries for headers and params, yet I get the 206 response and server error. I have all the mandatory parameters and header fields. Ignore any indent problems, they're just pasted wrong. There should be no problems related to my spotify dev account affecting the app/client.

headers = {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    }

    code_params = {
        'response_type': 'code',
        'client_id': CLIENT_ID,
        'redirect_uri': REDIRECT_URI,
        'scope': 'user-read-private user-read-email',
    }


    code = requests.get('https://accounts.spotify.com/authorize', params=code_params, headers=headers).json()

So, the authentication code request is supposed to redirect you to login and give permissions. Instead of calling.json(), you need to use.url and navigate to that website to get that redirect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM