Skip to content

Commit 31096ee

Browse files
nicman42nightowlengineer
authored andcommitted
fix for "415 Unsupported Media Type" response from server
with content "RESTEASY003065: Cannot consume content type"
1 parent 489c961 commit 31096ee

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/engineer/nightowl/sonos/api/resource/BaseResource.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ <T> T callApi(final HttpUriRequest request, final Class<T> type) throws SonosApi
8989
throw new SonosApiClientException("Unable to convert response body", ioe);
9090
}
9191

92-
logger.debug("Raw response from API: {}", new String(bytes));
92+
logger.debug("Raw response from API: {}", response);
93+
logger.debug("Raw response content from API: {}", new String(bytes));
9394

9495
// Get type from Sonos response - not always possible
9596
final SonosType sonosDeclaredClass = getTypeFromHeader(response);
@@ -208,7 +209,7 @@ <T> T deleteFromApi(final Class<T> returnType, final String token, final String
208209
*/
209210
<T> T postToApi(final Class<T> returnType, final String token, final String path) throws SonosApiClientException, SonosApiError
210211
{
211-
return postToApi(returnType, token, path, null);
212+
return postToApi(returnType, token, path, new String[0]);
212213
}
213214

214215
/**

0 commit comments

Comments
 (0)