Refresh Code Fix
~ Parameter type corrected
~ "Content-Type" header set
@@ -28,16 +28,17 @@ public class AuthorizationCodeRefreshRequest extends AbstractAthorizationRequest
public Builder grant_type(final String grant_type) {
assert (grant_type != null);
assert (grant_type.equals("refresh_token"));
- return setBodyParameter("grant_type", grant_type);
+ return setFormParameter("grant_type", grant_type);
}
public Builder refresh_token(final String refresh_token) {
assert (refresh_token != null);
assert (!refresh_token.equals(""));
- return setBodyParameter("refresh_token", refresh_token);
+ return setFormParameter("refresh_token", refresh_token);
}
public AuthorizationCodeRefreshRequest build() {
+ setHeader("Content-Type", "application/x-www-form-urlencoded");
setHost(SpotifyApi.DEFAULT_AUTHENTICATION_HOST);
setPort(SpotifyApi.DEFAULT_AUTHENTICATION_PORT);
setScheme(SpotifyApi.DEFAULT_AUTHENTICATION_SCHEME);
