Package org.springframework.http

# Interface StreamingHttpOutputMessage

All Superinterfaces:
  `HttpMessage`, `HttpOutputMessage`

public interface StreamingHttpOutputMessage extends HttpOutputMessage
Contract for `HttpOutputMessage` implementations to expose the ability to stream request body content by writing to an `OutputStream` from a callback.

The `setBody(Body)` method provides the option to stream, and is mutually exclusive use of `HttpOutputMessage.getBody()`, which instead returns an `OutputStream` that aggregates the request body before sending it.

Since:
  4.0
Author:
  Arjen Poutsma, Rossen Stoyanchev
See Also:
  - `setBody(org.springframework.http.StreamingHttpOutputMessage.Body)`

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static interface`
`StreamingHttpOutputMessage.Body`
Contract to stream request body content to an `OutputStream`.

## Method Summary

Modifier and Type
Method
Description
`void`
`setBody(StreamingHttpOutputMessage.Body body)`
Set the streaming body callback for this message.

### Methods inherited from interface org.springframework.http.HttpMessage

`getHeaders`

### Methods inherited from interface org.springframework.http.HttpOutputMessage

`getBody`

## Method Details

### setBody

void setBody(StreamingHttpOutputMessage.Body body)
Set the streaming body callback for this message.

Note that this is mutually exclusive with `HttpOutputMessage.getBody()`, which may instead aggregate the request body before sending it.

Parameters:
  `body` - the streaming body callback