public final class StreamingHttpResponses
extends java.lang.Object
StreamingHttpResponse
s.Modifier and Type | Method and Description |
---|---|
static StreamingHttpResponse |
newResponse(HttpResponseStatus status,
HttpProtocolVersion version,
HttpHeaders headers,
BufferAllocator allocator,
HttpHeadersFactory headersFactory)
Create a new instance using HTTP 1.1 with empty payload body.
|
static StreamingHttpResponse |
newTransportResponse(HttpResponseStatus status,
HttpProtocolVersion version,
HttpHeaders headers,
BufferAllocator allocator,
Publisher<java.lang.Object> payload,
HttpHeadersFactory headersFactory)
Creates a new
StreamingHttpResponse which is read from the transport. |
public static StreamingHttpResponse newResponse(HttpResponseStatus status, HttpProtocolVersion version, HttpHeaders headers, BufferAllocator allocator, HttpHeadersFactory headersFactory)
status
- the HttpResponseStatus
of the response.version
- the HttpProtocolVersion
of the response.headers
- the HttpHeaders
of the response.allocator
- the allocator used for serialization purposes if necessary.headersFactory
- HttpHeadersFactory
to use.StreamingHttpResponse
.public static StreamingHttpResponse newTransportResponse(HttpResponseStatus status, HttpProtocolVersion version, HttpHeaders headers, BufferAllocator allocator, Publisher<java.lang.Object> payload, HttpHeadersFactory headersFactory)
StreamingHttpResponse
which is read from the transport. If the response contains
trailers then the passed payload
Publisher
should also emit HttpHeaders
before completion.status
- the HttpResponseStatus
of the response.version
- the HttpProtocolVersion
of the response.headers
- the HttpHeaders
of the response.allocator
- the allocator used for serialization purposes if necessary.payload
- a Publisher
for payload that optionally emits HttpHeaders
if the
response contains trailers.headersFactory
- HttpHeadersFactory
to use.StreamingHttpResponse
.