Open hostmenow opened 6 months ago
I'm in a similar situation. I tried using the ResponseEntity<InputStreamResource>
as response type with no luck(stream closed). It seems that the DefaultRestClient
unconditionally closes the ClientHttpResponse
in twr.
Is there any update on supporting InputStream? I tried with Resource and InputStream but no luck. We are planning to migrate to the HTTP interface, is there any other alternative to support file download?
HTTP Interfaces are great but it's impossible to replace pure RestClient calls in all cases. For instance, code like
or
cannot be replaced with HTTP Interface (as I know).
It causes minor inconvenience as HTTP Interface is used in 99% cases but RestClient is still injected to cover cases like download/upload large files without significant memory consumption and all other cases where Stream processing is needed.
Propose to add: