@@ -112,7 +112,7 @@ public AccessToken retrieveAccessToken(Scope... scopes) {
112112 .property (HttpAuthenticationFeature .HTTP_AUTHENTICATION_PASSWORD , clientSecret )
113113 .property (ClientProperties .CONNECT_TIMEOUT , connectionTimeout )
114114 .property (ClientProperties .READ_TIMEOUT , readTimeout )
115- .post (Entity .entity (form , MediaType . APPLICATION_FORM_URLENCODED_TYPE ));
115+ .post (Entity .form (form ));
116116
117117 status = response .getStatusInfo ();
118118 content = response .readEntity (String .class );
@@ -143,7 +143,7 @@ public AccessToken retrieveAccessToken(String userName, String password, Scope..
143143 .property (HttpAuthenticationFeature .HTTP_AUTHENTICATION_PASSWORD , clientSecret )
144144 .property (ClientProperties .CONNECT_TIMEOUT , connectionTimeout )
145145 .property (ClientProperties .READ_TIMEOUT , readTimeout )
146- .post (Entity .entity (form , MediaType . APPLICATION_FORM_URLENCODED_TYPE ));
146+ .post (Entity .form (form ));
147147
148148 status = response .getStatusInfo ();
149149 content = response .readEntity (String .class );
@@ -174,7 +174,7 @@ public AccessToken retrieveAccessToken(String authCode) {
174174 .property (HttpAuthenticationFeature .HTTP_AUTHENTICATION_PASSWORD , clientSecret )
175175 .property (ClientProperties .CONNECT_TIMEOUT , connectionTimeout )
176176 .property (ClientProperties .READ_TIMEOUT , readTimeout )
177- .post (Entity .entity (form , MediaType . APPLICATION_FORM_URLENCODED_TYPE ));
177+ .post (Entity .form (form ));
178178
179179 status = response .getStatusInfo ();
180180 content = response .readEntity (String .class );
@@ -222,7 +222,7 @@ public AccessToken refreshAccessToken(AccessToken accessToken, Scope... scopes)
222222 .property (HttpAuthenticationFeature .HTTP_AUTHENTICATION_PASSWORD , clientSecret )
223223 .property (ClientProperties .CONNECT_TIMEOUT , connectionTimeout )
224224 .property (ClientProperties .READ_TIMEOUT , readTimeout )
225- .post (Entity .entity (form , MediaType . APPLICATION_FORM_URLENCODED_TYPE ));
225+ .post (Entity .form (form ));
226226
227227 status = response .getStatusInfo ();
228228 content = response .readEntity (String .class );
@@ -271,7 +271,7 @@ public AccessToken validateAccessToken(AccessToken tokenToValidate) {
271271 .property (ClientProperties .CONNECT_TIMEOUT , connectionTimeout )
272272 .property (ClientProperties .READ_TIMEOUT , readTimeout )
273273 .header (AUTHORIZATION_HEADER , BEARER + tokenToValidate .getToken ())
274- .post (null );
274+ .post (Entity . json ( "" ) );
275275
276276 status = response .getStatusInfo ();
277277 content = response .readEntity (String .class );
@@ -295,7 +295,7 @@ public void revokeAccessToken(AccessToken tokenToRevoke) {
295295 .property (ClientProperties .CONNECT_TIMEOUT , connectionTimeout )
296296 .property (ClientProperties .READ_TIMEOUT , readTimeout )
297297 .header (AUTHORIZATION_HEADER , BEARER + tokenToRevoke .getToken ())
298- .post (null );
298+ .post (Entity . json ( "" ) );
299299
300300 status = response .getStatusInfo ();
301301 content = response .readEntity (String .class );
@@ -317,7 +317,7 @@ public void revokeAllAccessTokens(String id, AccessToken accessToken) {
317317 .property (ClientProperties .CONNECT_TIMEOUT , connectionTimeout )
318318 .property (ClientProperties .READ_TIMEOUT , readTimeout )
319319 .header (AUTHORIZATION_HEADER , BEARER + accessToken .getToken ())
320- .post (null );
320+ .post (Entity . json ( "" ) );
321321
322322 status = response .getStatusInfo ();
323323 content = response .readEntity (String .class );
@@ -347,7 +347,7 @@ public Client createClient(Client client, AccessToken accessToken) {
347347 .property (ClientProperties .CONNECT_TIMEOUT , connectionTimeout )
348348 .property (ClientProperties .READ_TIMEOUT , readTimeout )
349349 .header (AUTHORIZATION_HEADER , BEARER + accessToken .getToken ())
350- .post (Entity .entity (clientAsString , MediaType . APPLICATION_JSON ));
350+ .post (Entity .json (clientAsString ));
351351
352352 status = response .getStatusInfo ();
353353 createdClient = response .readEntity (String .class );
@@ -467,7 +467,7 @@ public Client updateClient(String updateClientId, Client client, AccessToken acc
467467 .property (ClientProperties .CONNECT_TIMEOUT , connectionTimeout )
468468 .property (ClientProperties .READ_TIMEOUT , readTimeout )
469469 .header (AUTHORIZATION_HEADER , BEARER + accessToken .getToken ())
470- .put (Entity .entity (clientAsString , MediaType . APPLICATION_JSON ));
470+ .put (Entity .json (clientAsString ));
471471
472472 status = response .getStatusInfo ();
473473 clientResponse = response .readEntity (String .class );
0 commit comments