Seweryn
12/21/2023, 10:33 AM"response": {
"status": 200,
"headers": {
"content-type": "application/json"
},
"jsonBody": {
"content": <byte[]>
},
"transformers": [
"json-body-transformer"
]
}
Does anyone know how to do it or where to find some hints ? Thank you so much and have a lovely Christmas time !Tom
12/21/2023, 11:03 AMSeweryn
12/21/2023, 11:10 AMpublic class FileContent {
@NotNull
@JsonProperty
private final byte[] content;
Seweryn
12/21/2023, 9:16 PMResponseEntity<FileContent> response = restTemplate.exchange(apiURL, HttpMethod.GET, request, FileContent.class);
Tom
12/21/2023, 9:17 PMSeweryn
12/21/2023, 9:18 PMCould not extract response: no suitable HttpMessageConverter found for response type [class com.mydomain.FileContent] and content type [application/octet-stream]
Tom
12/21/2023, 9:19 PMContent-Type
of application/json
Tom
12/21/2023, 9:19 PMSeweryn
12/21/2023, 9:21 PMorg.springframework.web.client.RestClientException: Error while extracting response for type [class com.mydomain.FileContent] and content type [application/json]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unexpected character ('%' (code 37)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('%' (code 37)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')