【发布时间】:2017-11-22 01:44:01
【问题描述】:
现在我正在尝试通过 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);
谢谢你帮助我!
【问题讨论】: