public interface StreamedResponse
The HTTP status and response headers are available immediately, the response content can be accessed by
subscribing to the Publisher
returned from getBody()
or can
be directly streamed as a server response using send(ratpack.http.Response, ratpack.func.Action)
.
Modifier and Type | Method and Description |
---|---|
TransformablePublisher<ByteBuf> |
getBody() |
Headers |
getHeaders() |
Status |
getStatus() |
int |
getStatusCode() |
void |
send(Response response)
Stream this received response out to the given server response.
|
void |
send(Response response,
Action<? super MutableHeaders> headerMutator)
Stream this received response out to the given server response.
|
int getStatusCode()
TransformablePublisher<ByteBuf> getBody()
Publisher
of response content chunks.void send(Response response)
response
- the server response to stream tosend(ratpack.http.Response, ratpack.func.Action)
void send(Response response, Action<? super MutableHeaders> headerMutator)
The HTTP status and response headers of this response will be copied to the given server response. If this response
has a content-length
http header it will be excluded from the copy as all responses will be streamed with a
transfer-encoding
of chunked
. Outgoing response headers can be added and modified with the given
header mutating Action
.
This method will stream the response content chunks unmodified to the given server response using the publisher returned
from getBody()
.
response
- the server response to stream toheaderMutator
- an action that will act on the outgoing response headers