public interface BlockingStreamingHttpRequest extends HttpRequestMetaData
HttpRequest but provides the payload as a BlockingIterable.| Modifier and Type | Method and Description |
|---|---|
default BlockingStreamingHttpRequest |
addCookie(CharSequence name,
CharSequence value)
|
default BlockingStreamingHttpRequest |
addCookie(HttpCookiePair cookie)
Adds a cookie.
|
default BlockingStreamingHttpRequest |
addHeader(CharSequence name,
CharSequence value)
Adds a new header with the specified
name and value. |
default BlockingStreamingHttpRequest |
addHeaders(HttpHeaders headers)
Adds all header names and values of
headers object. |
BlockingStreamingHttpRequest |
addQueryParameter(String key,
String value)
Adds a new query parameter with the specified
key and value, which will be
percent-encoded if needed. |
BlockingStreamingHttpRequest |
addQueryParameters(String key,
Iterable<String> values)
Adds new query parameters with the specified
key and values. |
BlockingStreamingHttpRequest |
addQueryParameters(String key,
String... values)
Adds new query parameters with the specified
key and values. |
default BlockingStreamingHttpRequest |
addSetCookie(CharSequence name,
CharSequence value)
|
default BlockingStreamingHttpRequest |
addSetCookie(HttpSetCookie cookie)
Adds a set-cookie.
|
BlockingStreamingHttpRequest |
appendPathSegments(String... segments)
Appends segments to the current
HttpRequestMetaData.path(), performing encoding of each segment
(including ('/') characters) according
to percent-encoding. |
BlockingStreamingHttpRequest |
method(HttpRequestMethod method)
Set the
HttpRequestMethod of this StreamingHttpRequest. |
BlockingStreamingHttpRequest |
path(String path)
Sets the path, performing encoding according
to percent-encoding, except for forward-slash
(
'/') characters. |
BlockingIterable<Buffer> |
payloadBody()
Gets the underlying payload as a
Publisher of Buffers. |
BlockingStreamingHttpRequest |
payloadBody(CloseableIterable<Buffer> payloadBody)
Returns a
BlockingStreamingHttpRequest with its underlying payload set to payloadBody. |
<T> BlockingStreamingHttpRequest |
payloadBody(CloseableIterable<T> payloadBody,
HttpSerializer<T> serializer)
Returns a
BlockingStreamingHttpRequest with its underlying payload set to the result of serialization. |
default <T> BlockingIterable<T> |
payloadBody(HttpDeserializer<T> deserializer)
Gets and deserializes the payload body.
|
BlockingStreamingHttpRequest |
payloadBody(Iterable<Buffer> payloadBody)
Returns a
BlockingStreamingHttpRequest with its underlying payload set to payloadBody. |
<T> BlockingStreamingHttpRequest |
payloadBody(Iterable<T> payloadBody,
HttpSerializer<T> serializer)
Returns a
BlockingStreamingHttpRequest with its underlying payload set to the result of serialization. |
default InputStream |
payloadBodyInputStream()
Gets the underlying payload as a
InputStream. |
BlockingStreamingHttpRequest |
rawPath(String path)
Sets the path to
path, without any encoding performed. |
BlockingStreamingHttpRequest |
rawQuery(String query)
Sets the query component to
query, without
any encoding performed. |
BlockingStreamingHttpRequest |
requestTarget(String requestTarget)
Set the request-target.
|
default BlockingStreamingHttpRequest |
setHeader(CharSequence name,
CharSequence value)
Sets a header with the specified
name and value. |
default BlockingStreamingHttpRequest |
setHeaders(HttpHeaders headers)
Clears the current header entries and copies all header entries of the specified
headers object. |
BlockingStreamingHttpRequest |
setQueryParameter(String key,
String value)
|
BlockingStreamingHttpRequest |
setQueryParameters(String key,
Iterable<String> values)
Sets new query parameters with the specified
key and values. |
BlockingStreamingHttpRequest |
setQueryParameters(String key,
String... values)
Sets new query parameters with the specified
key and values. |
Single<HttpRequest> |
toRequest()
Translates this
BlockingStreamingHttpRequest to a HttpRequest. |
StreamingHttpRequest |
toStreamingRequest()
Translates this
BlockingStreamingHttpRequest to a StreamingHttpRequest. |
<T> BlockingStreamingHttpRequest |
transform(TrailersTransformer<T,Buffer> trailersTransformer)
Returns a
BlockingStreamingHttpRequest with its underlying payload transformed to Buffers,
with access to the trailers. |
<T> BlockingStreamingHttpRequest |
transformPayloadBody(Function<BlockingIterable<Buffer>,BlockingIterable<T>> transformer,
HttpSerializer<T> serializer)
Returns a
BlockingStreamingHttpRequest with its underlying payload transformed to the result of
serialization. |
default <T,R> BlockingStreamingHttpRequest |
transformPayloadBody(Function<BlockingIterable<T>,BlockingIterable<R>> transformer,
HttpDeserializer<T> deserializer,
HttpSerializer<R> serializer)
Returns a
BlockingStreamingHttpRequest with its underlying payload transformed to the result of
serialization. |
BlockingStreamingHttpRequest |
transformPayloadBody(UnaryOperator<BlockingIterable<Buffer>> transformer)
Returns a
BlockingStreamingHttpRequest with its underlying payload transformed to Buffers. |
<T> BlockingStreamingHttpRequest |
transformRaw(TrailersTransformer<T,Object> trailersTransformer)
Returns a
BlockingStreamingHttpRequest with its underlying payload transformed to Objects,
with access to the trailers. |
BlockingStreamingHttpRequest |
transformRawPayloadBody(UnaryOperator<BlockingIterable<?>> transformer)
Returns a
BlockingStreamingHttpRequest with its underlying payload transformed. |
BlockingStreamingHttpRequest |
version(HttpProtocolVersion version)
Set the protocol version of this
HttpMetaData. |
effectiveHost, effectivePort, hasQueryParameter, hasQueryParameter, host, method, path, port, queryParameter, queryParameters, queryParameters, queryParametersIterator, queryParametersKeys, queryParametersSize, rawPath, rawQuery, removeQueryParameters, removeQueryParameters, requestTarget, scheme, userInfoheaders, toString, toString, versionBlockingIterable<Buffer> payloadBody()
Publisher of Buffers.Publisher of Buffer representation of the underlying payload body.default InputStream payloadBodyInputStream()
InputStream.InputStream representation of the underlying payload body.default <T> BlockingIterable<T> payloadBody(HttpDeserializer<T> deserializer)
T - The resulting type of the deserialization operation.deserializer - The function that deserializes the underlying BlockingIterable.BlockingStreamingHttpRequest payloadBody(Iterable<Buffer> payloadBody)
BlockingStreamingHttpRequest with its underlying payload set to payloadBody.
A best effort will be made to apply back pressure to the existing Iterable payload body. If this
default policy is not sufficient you can use transformPayloadBody(UnaryOperator) for more fine grain
control.
This method reserves the right to delay completion/consumption of payloadBody. This may occur due to the
combination with the existing Iterable payload body.
payloadBody - The new payload body.thisBlockingStreamingHttpRequest payloadBody(CloseableIterable<Buffer> payloadBody)
BlockingStreamingHttpRequest with its underlying payload set to payloadBody.
A best effort will be made to apply back pressure to the existing CloseableIterable payload body. If this
default policy is not sufficient you can use transformPayloadBody(UnaryOperator) for more fine grain
control.
This method reserves the right to delay completion/consumption of payloadBody. This may occur due to the
combination with the existing CloseableIterable payload body.
payloadBody - The new payload body.this<T> BlockingStreamingHttpRequest payloadBody(Iterable<T> payloadBody, HttpSerializer<T> serializer)
BlockingStreamingHttpRequest with its underlying payload set to the result of serialization.
A best effort will be made to apply back pressure to the existing Iterable payload body. If this
default policy is not sufficient you can use transformPayloadBody(Function, HttpSerializer) for more
fine grain control.
This method reserves the right to delay completion/consumption of payloadBody. This may occur due to the
combination with the existing Iterable payload body.
T - The type of objects to serialize.payloadBody - The new payload body, prior to serialization.serializer - Used to serialize the payload body.this<T> BlockingStreamingHttpRequest payloadBody(CloseableIterable<T> payloadBody, HttpSerializer<T> serializer)
BlockingStreamingHttpRequest with its underlying payload set to the result of serialization.
A best effort will be made to apply back pressure to the existing CloseableIterable payload body. If this
default policy is not sufficient you can use transformPayloadBody(Function, HttpSerializer) for more
fine grain control.
This method reserves the right to delay completion/consumption of payloadBody. This may occur due to the
combination with the existing CloseableIterable payload body.
T - The type of objects to serialize.payloadBody - The new payload body, prior to serialization.serializer - Used to serialize the payload body.this<T> BlockingStreamingHttpRequest transformPayloadBody(Function<BlockingIterable<Buffer>,BlockingIterable<T>> transformer, HttpSerializer<T> serializer)
BlockingStreamingHttpRequest with its underlying payload transformed to the result of
serialization.T - The type of objects to serialize.transformer - A Function which take as a parameter the existing payload body
BlockingIterable and returns the new payload body BlockingIterable prior to serialization. It is
assumed the existing payload body BlockingIterable will be transformed/consumed or else no more requests
may be processed.serializer - Used to serialize the payload body.thisdefault <T,R> BlockingStreamingHttpRequest transformPayloadBody(Function<BlockingIterable<T>,BlockingIterable<R>> transformer, HttpDeserializer<T> deserializer, HttpSerializer<R> serializer)
BlockingStreamingHttpRequest with its underlying payload transformed to the result of
serialization.T - The type of objects to deserialize.R - The type of objects to serialize.transformer - A Function which take as a parameter the existing payload body
BlockingIterable and returns the new payload body BlockingIterable prior to serialization. It is
assumed the existing payload body BlockingIterable will be transformed/consumed or else no more requests
may be processed.deserializer - Used to deserialize the existing payload body.serializer - Used to serialize the payload body.thisBlockingStreamingHttpRequest transformPayloadBody(UnaryOperator<BlockingIterable<Buffer>> transformer)
BlockingStreamingHttpRequest with its underlying payload transformed to Buffers.transformer - A Function which take as a parameter the existing payload body
BlockingIterable and returns the new payload body BlockingIterable. It is assumed the existing
payload body BlockingIterable will be transformed/consumed or else no more requests may be processed.thisBlockingStreamingHttpRequest transformRawPayloadBody(UnaryOperator<BlockingIterable<?>> transformer)
BlockingStreamingHttpRequest with its underlying payload transformed. Note that the raw objects
of the underlying Iterable may be exposed. The object types are not guaranteed to be homogeneous.transformer - Responsible for transforming the payload body.this<T> BlockingStreamingHttpRequest transform(TrailersTransformer<T,Buffer> trailersTransformer)
BlockingStreamingHttpRequest with its underlying payload transformed to Buffers,
with access to the trailers.T - The type of state used during the transformation.trailersTransformer - TrailersTransformer to use for this transform.this<T> BlockingStreamingHttpRequest transformRaw(TrailersTransformer<T,Object> trailersTransformer)
BlockingStreamingHttpRequest with its underlying payload transformed to Objects,
with access to the trailers.T - The type of state used during the transformation.trailersTransformer - TrailersTransformer to use for this transform.thisSingle<HttpRequest> toRequest()
BlockingStreamingHttpRequest to a HttpRequest.Single that completes with a HttpRequest representation of this
BlockingStreamingHttpRequest.StreamingHttpRequest toStreamingRequest()
BlockingStreamingHttpRequest to a StreamingHttpRequest.StreamingHttpRequest representation of this BlockingStreamingHttpRequest.BlockingStreamingHttpRequest rawPath(String path)
HttpRequestMetaDatapath, without any encoding performed. This assumes that any characters that require
encoding have been encoded according
to percent-encoding by the caller.
Because this modifies the request target, this may result in the clearing of internal caches.
See HttpRequestMetaData.requestTarget(String).
rawPath in interface HttpRequestMetaDatapath - the encoded path to set.this.BlockingStreamingHttpRequest path(String path)
HttpRequestMetaData'/') characters. This allows for path("/abc") without it turning into
'%2Fabc'.path in interface HttpRequestMetaDatapath - the un-encoded path to set.this.BlockingStreamingHttpRequest appendPathSegments(String... segments)
HttpRequestMetaDataHttpRequestMetaData.path(), performing encoding of each segment
(including ('/') characters) according
to percent-encoding.
A / is used to separate each segment and between the current HttpRequestMetaData.path() and the following segments.appendPathSegments in interface HttpRequestMetaDatasegments - the un-encoded path to set.this.BlockingStreamingHttpRequest rawQuery(String query)
HttpRequestMetaDataquery, without
any encoding performed. This assumes that any characters that require encoding have been encoded according to
percent-encoding by the caller.
Because this modifies the request target, this may result in the clearing of internal caches.
See HttpRequestMetaData.requestTarget(String).
rawQuery in interface HttpRequestMetaDataquery - the encoded query to set.this.BlockingStreamingHttpRequest addQueryParameter(String key, String value)
HttpRequestMetaDatakey and value, which will be
percent-encoded if needed.addQueryParameter in interface HttpRequestMetaDatakey - the query parameter key.value - the query parameter value.this.BlockingStreamingHttpRequest addQueryParameters(String key, Iterable<String> values)
HttpRequestMetaDatakey and values. This method is semantically
equivalent to:
for (T value : values) {
addQueryParameter(key, value);
}
addQueryParameters in interface HttpRequestMetaDatakey - the query parameter key.values - the query parameter values.this.BlockingStreamingHttpRequest addQueryParameters(String key, String... values)
HttpRequestMetaDatakey and values. This method is semantically
equivalent to:
for (T value : values) {
query.addQueryParameter(key, value);
}
addQueryParameters in interface HttpRequestMetaDatakey - the query parameter key.values - the query parameter values.this.BlockingStreamingHttpRequest setQueryParameter(String key, String value)
HttpRequestMetaDatakey and value, which will be
percent-encoded if needed.
Any existing query parameters with the same key are overwritten.setQueryParameter in interface HttpRequestMetaDatakey - the query parameter key.value - the query parameter value.this.BlockingStreamingHttpRequest setQueryParameters(String key, Iterable<String> values)
HttpRequestMetaDatakey and values. This method is equivalent to:
removeQueryParameter(key);
for (T value : values) {
query.addQueryParameter(key, value);
}
setQueryParameters in interface HttpRequestMetaDatakey - the query parameter key.values - the query parameter values.this.BlockingStreamingHttpRequest setQueryParameters(String key, String... values)
HttpRequestMetaDatakey and values. This method is equivalent to:
removeQueryParameter(key);
for (T value : values) {
query.addQueryParameter(key, value);
}
setQueryParameters in interface HttpRequestMetaDatakey - the query parameter key.values - the query parameter values.this.BlockingStreamingHttpRequest version(HttpProtocolVersion version)
HttpMetaDataHttpMetaData.version in interface HttpMetaDataversion in interface HttpRequestMetaDataversion - the protocol version to set.this.BlockingStreamingHttpRequest method(HttpRequestMethod method)
HttpRequestMetaDataHttpRequestMethod of this StreamingHttpRequest.method in interface HttpRequestMetaDatamethod - the HttpRequestMethod to set.this.BlockingStreamingHttpRequest requestTarget(String requestTarget)
HttpRequestMetaDataThis will be treated as encoded according to percent-encoding.
This may result in clearing of internal caches used by methods that are derived from the request-target,
such as HttpRequestMetaData.path(), HttpRequestMetaData.rawQuery(), etc.
requestTarget in interface HttpRequestMetaDatarequestTarget - the percent-encoded
request-target to set.this.default BlockingStreamingHttpRequest addHeader(CharSequence name, CharSequence value)
HttpMetaDataname and value.addHeader in interface HttpMetaDataaddHeader in interface HttpRequestMetaDataname - the name of the header.value - the value of the header.this.default BlockingStreamingHttpRequest addHeaders(HttpHeaders headers)
HttpMetaDataheaders object.addHeaders in interface HttpMetaDataaddHeaders in interface HttpRequestMetaDataheaders - the headers to add.this.default BlockingStreamingHttpRequest setHeader(CharSequence name, CharSequence value)
HttpMetaDataname and value. Any existing headers with the same name are
overwritten.setHeader in interface HttpMetaDatasetHeader in interface HttpRequestMetaDataname - the name of the header.value - the value of the header.this.default BlockingStreamingHttpRequest setHeaders(HttpHeaders headers)
HttpMetaDataheaders object.setHeaders in interface HttpMetaDatasetHeaders in interface HttpRequestMetaDataheaders - the headers object which contains new values.this.default BlockingStreamingHttpRequest addCookie(HttpCookiePair cookie)
HttpMetaData
This may result in multiple HttpCookiePairs with same name.
addCookie in interface HttpMetaDataaddCookie in interface HttpRequestMetaDatacookie - the cookie to add.this.default BlockingStreamingHttpRequest addCookie(CharSequence name, CharSequence value)
HttpMetaDataname and
value.
This may result in multiple HttpSetCookies with same name. Added cookie will not be wrapped, not secure,
and not HTTP-only, with no path, domain, expire date and maximum age.
addCookie in interface HttpMetaDataaddCookie in interface HttpRequestMetaDataname - the name of the cookie.value - the value of the cookie.this.default BlockingStreamingHttpRequest addSetCookie(HttpSetCookie cookie)
HttpMetaData
This may result in multiple HttpSetCookies with same name.
addSetCookie in interface HttpMetaDataaddSetCookie in interface HttpRequestMetaDatacookie - the cookie to add.this.default BlockingStreamingHttpRequest addSetCookie(CharSequence name, CharSequence value)
HttpMetaDataname
and value.
This may result in multiple HttpSetCookies with same name. Added cookie will not be wrapped, not secure,
and not HTTP-only, with no path, domain, expire date and maximum age.
addSetCookie in interface HttpMetaDataaddSetCookie in interface HttpRequestMetaDataname - the name of the cookie.value - the value of the cookie.this.