Interface ServerResponse.StreamBuilder
- All Superinterfaces:
ServerResponse.AsyncBuilder<ServerResponse.StreamBuilder>
- Enclosing interface:
- ServerResponse
public static interface ServerResponse.StreamBuilder
extends ServerResponse.AsyncBuilder<ServerResponse.StreamBuilder>
Defines a builder for a streaming response body.
- Since:
- 6.2
-
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
Flush the buffered response stream content to the network.Write the given object to the response stream, without flushing.Write the given object to the response stream, without flushing.Methods inherited from interface org.springframework.web.servlet.function.ServerResponse.AsyncBuilder
complete, error, onComplete, onError, onTimeout
-
Method Details
-
write
Write the given object to the response stream, without flushing. Strings will be sent as UTF-8 encoded bytes, byte arrays will be sent as-is, and other objects will be converted into JSON using message converters.- Parameters:
object
- the object to send as data- Returns:
- this builder
- Throws:
IOException
- in case of I/O errors
-
write
Write the given object to the response stream, without flushing. Strings will be sent as UTF-8 encoded bytes, byte arrays will be sent as-is, and other objects will be converted into JSON using message converters.- Parameters:
object
- the object to send as datamediaType
- the media type to use for encoding the provided data- Returns:
- this builder
- Throws:
IOException
- in case of I/O errors
-
flush
Flush the buffered response stream content to the network.- Throws:
IOException
- in case of I/O errors
-