Package io.servicetalk.http.api
Class StreamingHttpRequests
java.lang.Object
io.servicetalk.http.api.StreamingHttpRequests
Factory methods for creating
StreamingHttpRequests.-
Method Summary
Modifier and TypeMethodDescriptionstatic StreamingHttpRequestnewRequest(HttpRequestMethod method, String requestTarget, HttpProtocolVersion version, HttpHeaders headers, BufferAllocator allocator, HttpHeadersFactory headersFactory) Creates a newStreamingHttpRequest.static StreamingHttpRequestnewTransportRequest(HttpRequestMetaData metaData, BufferAllocator allocator, Publisher<Object> payload, boolean requireTrailerHeader, HttpHeadersFactory headersFactory) Creates a newStreamingHttpRequestwhich is read from the transport.static StreamingHttpRequestnewTransportRequest(HttpRequestMethod method, String requestTarget, HttpProtocolVersion version, HttpHeaders headers, BufferAllocator allocator, Publisher<Object> payload, boolean requireTrailerHeader, HttpHeadersFactory headersFactory) Deprecated.
-
Method Details
-
newRequest
public static StreamingHttpRequest newRequest(HttpRequestMethod method, String requestTarget, HttpProtocolVersion version, HttpHeaders headers, BufferAllocator allocator, HttpHeadersFactory headersFactory) Creates a newStreamingHttpRequest.- Parameters:
method- theHttpRequestMethodof the request.requestTarget- the request-target of the request.version- theHttpProtocolVersionof the request.headers- theHttpHeadersof the request. Note that newly created and returnedStreamingHttpRequestwill use thisHttpHeadersdirectly, which means later mutation ofHttpHeaderswill have side effects on returned request and should be avoided as these operations are not thread safe.allocator- the allocator used for serialization purposes if necessary.headersFactory-HttpHeadersFactoryto use.- Returns:
- a new
StreamingHttpRequest.
-
newTransportRequest
@Deprecated public static StreamingHttpRequest newTransportRequest(HttpRequestMethod method, String requestTarget, HttpProtocolVersion version, HttpHeaders headers, BufferAllocator allocator, Publisher<Object> payload, boolean requireTrailerHeader, HttpHeadersFactory headersFactory) Deprecated.Creates a newStreamingHttpRequestwhich is read from the transport. If the request contains trailers then the passedpayloadPublishershould also emitHttpHeadersbefore completion.- Parameters:
method- theHttpRequestMethodof the request.requestTarget- the request-target of the request.version- theHttpProtocolVersionof the request.headers- theHttpHeadersof the request. Note that newly created and returnedStreamingHttpRequestwill use thisHttpHeadersdirectly, which means later mutation ofHttpHeaderswill have side effects on returned request and should be avoided as these operations are not thread safe.allocator- the allocator used for serialization purposes if necessary.payload- aPublisherfor payload that optionally emitsHttpHeadersif the request 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
StreamingHttpRequest.
-
newTransportRequest
public static StreamingHttpRequest newTransportRequest(HttpRequestMetaData metaData, BufferAllocator allocator, Publisher<Object> payload, boolean requireTrailerHeader, HttpHeadersFactory headersFactory) Creates a newStreamingHttpRequestwhich is read from the transport.If the request contains trailers then the passed
payloadPublishermust also emitHttpHeadersbefore completion.- Parameters:
metaData- theHttpRequestMetaDataof the request parsed by the transport layer. Note that newly created and returnedStreamingHttpRequestwill use thisHttpRequestMetaDatadirectly and share its parts, which means later mutation ofHttpRequestMetaDatawill have side effects on returned request and should be avoided as these operations are not thread safe.allocator- the allocator to use for serialization purposes if necessary.payload- aPublisherfor payload that optionally emitsHttpHeadersif the request contains trailers.requireTrailerHeader-trueif Trailer header is required to accept trailers.falseassumes trailers may be present if other criteria allows.headersFactory-HttpHeadersFactoryto use to allocate trailers if necessary.- Returns:
- a new
StreamingHttpRequest.
-
newTransportRequest(HttpRequestMetaData, BufferAllocator, Publisher, boolean, HttpHeadersFactory)instead.