Skip to content

Support OutputStream (or StreamingHttpOutputMessage.Body functional interface) and InputStream in HTTP Interface #32358

Open
@hostmenow

Description

@hostmenow

HTTP Interfaces are great but it's impossible to replace pure RestClient calls in all cases.
For instance, code like

restClient.put()
                .uri(...)
                .body(body ->  {
                   //use body as OutputStream
                 })
                .retrieve()
                .toBodilessEntity();

or

restClient.get()
                .uri(...)
                .exchange((req, resp) -> {
                    var inputStream = resp.getBody());
                    //use inputStream 
                });

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:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions