Skip to content
Advertisement

stream is closed and Could not find acceptable representation error

i’m consuming a Api witch is returning pdf as ResponseEntity but it is not working at my api

i’m trying to get de file coming from the external api and provide it at my endpoint.

# External Api FeignClient class

JavaScript

My service method

JavaScript

my endpoint

JavaScript

and stackTrace

enter image description here

i’m trying to get de file coming from the external api and provide it at my endpoint.

Advertisement

Answer

Replace InputStreamResouce with byte[] in Feign

JavaScript

and convert byte[] to InputStreamResource again in service

JavaScript
Advertisement