Package io.servicetalk.http.api
Class StreamingHttpResponses
- java.lang.Object
-
- io.servicetalk.http.api.StreamingHttpResponses
-
public final class StreamingHttpResponses extends java.lang.Object
Factory methods for creatingStreamingHttpResponse
s.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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 newStreamingHttpResponse
which is read from the transport.
-
-
-
Method Detail
-
newResponse
public 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.- Parameters:
status
- theHttpResponseStatus
of the response.version
- theHttpProtocolVersion
of the response.headers
- theHttpHeaders
of the response.allocator
- the allocator used for serialization purposes if necessary.headersFactory
-HttpHeadersFactory
to use.- Returns:
- a new
StreamingHttpResponse
.
-
newTransportResponse
public static StreamingHttpResponse newTransportResponse(HttpResponseStatus status, HttpProtocolVersion version, HttpHeaders headers, BufferAllocator allocator, Publisher<java.lang.Object> payload, HttpHeadersFactory headersFactory)
Creates a newStreamingHttpResponse
which is read from the transport. If the response contains trailers then the passedpayload
Publisher
should also emitHttpHeaders
before completion.- Parameters:
status
- theHttpResponseStatus
of the response.version
- theHttpProtocolVersion
of the response.headers
- theHttpHeaders
of the response.allocator
- the allocator used for serialization purposes if necessary.payload
- aPublisher
for payload that optionally emitsHttpHeaders
if the response contains trailers.headersFactory
-HttpHeadersFactory
to use.- Returns:
- a new
StreamingHttpResponse
.
-
-