Package io.servicetalk.http.api
Class StreamingHttpRequests
java.lang.Object
io.servicetalk.http.api.StreamingHttpRequests
Factory methods for creating
StreamingHttpRequest
s.-
Method Summary
Modifier and TypeMethodDescriptionstatic StreamingHttpRequest
newRequest
(HttpRequestMethod method, String requestTarget, HttpProtocolVersion version, HttpHeaders headers, BufferAllocator allocator, HttpHeadersFactory headersFactory) Creates a newStreamingHttpRequest
.static StreamingHttpRequest
newTransportRequest
(HttpRequestMethod method, String requestTarget, HttpProtocolVersion version, HttpHeaders headers, BufferAllocator allocator, Publisher<Object> payload, boolean requireTrailerHeader, HttpHeadersFactory headersFactory) Creates a newStreamingHttpRequest
which is read from the transport.
-
Method Details
-
newRequest
public static StreamingHttpRequest newRequest(HttpRequestMethod method, String requestTarget, HttpProtocolVersion version, HttpHeaders headers, BufferAllocator allocator, HttpHeadersFactory headersFactory) Creates a newStreamingHttpRequest
.- Parameters:
method
- theHttpRequestMethod
of the request.requestTarget
- the request-target of the request.version
- theHttpProtocolVersion
of the request.headers
- theHttpHeaders
of the request.allocator
- the allocator used for serialization purposes if necessary.headersFactory
-HttpHeadersFactory
to use.- Returns:
- a new
StreamingHttpRequest
.
-
newTransportRequest
public static StreamingHttpRequest newTransportRequest(HttpRequestMethod method, String requestTarget, HttpProtocolVersion version, HttpHeaders headers, BufferAllocator allocator, Publisher<Object> payload, boolean requireTrailerHeader, HttpHeadersFactory headersFactory) Creates a newStreamingHttpRequest
which is read from the transport. If the request contains trailers then the passedpayload
Publisher
should also emitHttpHeaders
before completion.- Parameters:
method
- theHttpRequestMethod
of the request.requestTarget
- the request-target of the request.version
- theHttpProtocolVersion
of the request.headers
- theHttpHeaders
of the request.allocator
- the allocator used for serialization purposes if necessary.payload
- aPublisher
for payload that optionally emitsHttpHeaders
if the request contains trailers.requireTrailerHeader
-true
if Trailer header is required to accept trailers.false
assumes trailers may be present if other criteria allows.headersFactory
-HttpHeadersFactory
to use.- Returns:
- a new
StreamingHttpRequest
.
-