现在,我正在尝试通过Spotify Web Api中的授权代码流方法将我的授权代码交换为令牌,但作为响应,我总是获得400状态。这是我正在使用的代码:
HttpPost httppost = new HttpPost(new URI("https://accounts.spotify.com/api/token/?grant_type=authorization_code&code=" + tempCode + "&redirect_uri=" + RedirectUri));
httppost.addHeader("Authorization", "Basic " + Base64.encodeBase64String((ClientId + ":" + ClientSecret).getBytes()));
httppost.setProtocolVersion(HttpVersion.HTTP_1_1);
感谢您帮助我!