Package io.servicetalk.http.api
Class StreamingHttpResponses
- java.lang.Object
-
- io.servicetalk.http.api.StreamingHttpResponses
-
public final class StreamingHttpResponses extends java.lang.ObjectFactory methods for creatingStreamingHttpResponses.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StreamingHttpResponsenewResponse(HttpResponseStatus status, HttpProtocolVersion version, HttpHeaders headers, BufferAllocator allocator, HttpHeadersFactory headersFactory)Create a new instance using HTTP 1.1 with empty payload body.static StreamingHttpResponsenewTransportResponse(HttpResponseStatus status, HttpProtocolVersion version, HttpHeaders headers, BufferAllocator allocator, Publisher<java.lang.Object> messageBody, boolean requireTrailerHeader, HttpHeadersFactory headersFactory)Creates a newStreamingHttpResponsewhich 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- theHttpResponseStatusof the response.version- theHttpProtocolVersionof the response.headers- theHttpHeadersof the response.allocator- the allocator used for serialization purposes if necessary.headersFactory-HttpHeadersFactoryto use.- Returns:
- a new
StreamingHttpResponse.
-
newTransportResponse
public static StreamingHttpResponse newTransportResponse(HttpResponseStatus status, HttpProtocolVersion version, HttpHeaders headers, BufferAllocator allocator, Publisher<java.lang.Object> messageBody, boolean requireTrailerHeader, HttpHeadersFactory headersFactory)
Creates a newStreamingHttpResponsewhich is read from the transport. If the response contains trailers then the passedpayloadPublishershould also emitHttpHeadersbefore completion.- Parameters:
status- theHttpResponseStatusof the response.version- theHttpProtocolVersionof the response.headers- theHttpHeadersof the response.allocator- the allocator used for serialization purposes if necessary.messageBody- aPublisherfor payload that optionally emitsHttpHeadersif the response contains trailers.requireTrailerHeader-trueif Trailer header is required to accept trailers.falseassumes trailers may be present if other criteria allows.headersFactory-HttpHeadersFactoryto use.- Returns:
- a new
StreamingHttpResponse.
-
-