mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-23 06:29:10 +00:00
Merge branch '6.2.x'
This commit is contained in:
@@ -477,7 +477,14 @@ final class DefaultRestClient implements RestClient {
|
||||
|
||||
@Override
|
||||
public RequestBodySpec body(StreamingHttpOutputMessage.Body body) {
|
||||
this.body = request -> body.writeTo(request.getBody());
|
||||
this.body = request -> {
|
||||
if (request instanceof StreamingHttpOutputMessage streamingMessage) {
|
||||
streamingMessage.setBody(body);
|
||||
}
|
||||
else {
|
||||
body.writeTo(request.getBody());
|
||||
}
|
||||
};
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user