public interface BlockingStreamingHttpRequest extends HttpRequestMetaData
HttpRequest
but provides the payload as a BlockingIterable
.Modifier and Type | Method and Description |
---|---|
default BlockingStreamingHttpRequest |
addCookie(java.lang.CharSequence name,
java.lang.CharSequence value)
|
default BlockingStreamingHttpRequest |
addCookie(HttpCookiePair cookie)
Adds a cookie.
|
default BlockingStreamingHttpRequest |
addHeader(java.lang.CharSequence name,
java.lang.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(java.lang.String key,
java.lang.String value)
Adds a new query parameter with the specified
key and value , which will be
percent-encoded if needed. |
BlockingStreamingHttpRequest |
addQueryParameters(java.lang.String key,
java.lang.Iterable<java.lang.String> values)
Adds new query parameters with the specified
key and values . |
BlockingStreamingHttpRequest |
addQueryParameters(java.lang.String key,
java.lang.String... values)
Adds new query parameters with the specified
key and values . |
default BlockingStreamingHttpRequest |
addSetCookie(java.lang.CharSequence name,
java.lang.CharSequence value)
|
default BlockingStreamingHttpRequest |
addSetCookie(HttpSetCookie cookie)
Adds a set-cookie.
|
BlockingStreamingHttpRequest |
appendPathSegments(java.lang.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(java.lang.String path)
Sets the path, performing encoding according
to percent-encoding, except for forward-slash
(
'/' ) characters. |
BlockingIterable<Buffer> |
payloadBody()
|
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(java.lang.Iterable<Buffer> payloadBody)
Returns a
BlockingStreamingHttpRequest with its underlying payload set to payloadBody . |
<T> BlockingStreamingHttpRequest |
payloadBody(java.lang.Iterable<T> payloadBody,
HttpSerializer<T> serializer)
Returns a
BlockingStreamingHttpRequest with its underlying payload set to the result of serialization. |
default java.io.InputStream |
payloadBodyInputStream()
Gets the underlying payload as a
InputStream . |
BlockingStreamingHttpRequest |
rawPath(java.lang.String path)
Sets the path to
path , without any encoding performed. |
BlockingStreamingHttpRequest |
rawQuery(java.lang.String query)
Sets the query component to
query , without
any encoding performed. |
BlockingStreamingHttpRequest |
requestTarget(java.lang.String requestTarget)
Set the request-target.
|
default BlockingStreamingHttpRequest |
setHeader(java.lang.CharSequence name,
java.lang.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(java.lang.String key,
java.lang.String value)
|
BlockingStreamingHttpRequest |
setQueryParameters(java.lang.String key,
java.lang.Iterable<java.lang.String> values)
Sets new query parameters with the specified
key and values . |
BlockingStreamingHttpRequest |
setQueryParameters(java.lang.String key,
java.lang.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 Buffer s,
with access to the trailers. |
<T> BlockingStreamingHttpRequest |
transformPayloadBody(java.util.function.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(java.util.function.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(java.util.function.UnaryOperator<BlockingIterable<Buffer>> transformer)
Returns a
BlockingStreamingHttpRequest with its underlying payload transformed to Buffer s. |
<T> BlockingStreamingHttpRequest |
transformRaw(TrailersTransformer<T,java.lang.Object> trailersTransformer)
Returns a
BlockingStreamingHttpRequest with its underlying payload transformed to Object s,
with access to the trailers. |
BlockingStreamingHttpRequest |
transformRawPayloadBody(java.util.function.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, userInfo
headers, toString, toString, version
BlockingIterable<Buffer> payloadBody()
default java.io.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(java.lang.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.this
BlockingStreamingHttpRequest 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(java.lang.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(java.util.function.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.this
default <T,R> BlockingStreamingHttpRequest transformPayloadBody(java.util.function.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.this
BlockingStreamingHttpRequest transformPayloadBody(java.util.function.UnaryOperator<BlockingIterable<Buffer>> transformer)
BlockingStreamingHttpRequest
with its underlying payload transformed to Buffer
s.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.this
BlockingStreamingHttpRequest transformRawPayloadBody(java.util.function.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 Buffer
s,
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,java.lang.Object> trailersTransformer)
BlockingStreamingHttpRequest
with its underlying payload transformed to Object
s,
with access to the trailers.T
- The type of state used during the transformation.trailersTransformer
- TrailersTransformer
to use for this transform.this
Single<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(java.lang.String path)
HttpRequestMetaData
path
, 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 HttpRequestMetaData
path
- the encoded path to set.this
.BlockingStreamingHttpRequest path(java.lang.String path)
HttpRequestMetaData
'/'
) characters. This allows for path("/abc")
without it turning into
'%2Fabc'
.path
in interface HttpRequestMetaData
path
- the un-encoded path to set.this
.BlockingStreamingHttpRequest appendPathSegments(java.lang.String... segments)
HttpRequestMetaData
HttpRequestMetaData.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 HttpRequestMetaData
segments
- the un-encoded path to set.this
.BlockingStreamingHttpRequest rawQuery(java.lang.String query)
HttpRequestMetaData
query
, 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 HttpRequestMetaData
query
- the encoded query to set.this
.BlockingStreamingHttpRequest addQueryParameter(java.lang.String key, java.lang.String value)
HttpRequestMetaData
key
and value
, which will be
percent-encoded if needed.addQueryParameter
in interface HttpRequestMetaData
key
- the query parameter key.value
- the query parameter value.this
.BlockingStreamingHttpRequest addQueryParameters(java.lang.String key, java.lang.Iterable<java.lang.String> values)
HttpRequestMetaData
key
and values
. This method is semantically
equivalent to:
for (T value : values) { addQueryParameter(key, value); }
addQueryParameters
in interface HttpRequestMetaData
key
- the query parameter key.values
- the query parameter values.this
.BlockingStreamingHttpRequest addQueryParameters(java.lang.String key, java.lang.String... values)
HttpRequestMetaData
key
and values
. This method is semantically
equivalent to:
for (T value : values) { query.addQueryParameter(key, value); }
addQueryParameters
in interface HttpRequestMetaData
key
- the query parameter key.values
- the query parameter values.this
.BlockingStreamingHttpRequest setQueryParameter(java.lang.String key, java.lang.String value)
HttpRequestMetaData
key
and value
, which will be
percent-encoded if needed.
Any existing query parameters with the same key are overwritten.setQueryParameter
in interface HttpRequestMetaData
key
- the query parameter key.value
- the query parameter value.this
.BlockingStreamingHttpRequest setQueryParameters(java.lang.String key, java.lang.Iterable<java.lang.String> values)
HttpRequestMetaData
key
and values
. This method is equivalent to:
removeQueryParameter(key); for (T value : values) { query.addQueryParameter(key, value); }
setQueryParameters
in interface HttpRequestMetaData
key
- the query parameter key.values
- the query parameter values.this
.BlockingStreamingHttpRequest setQueryParameters(java.lang.String key, java.lang.String... values)
HttpRequestMetaData
key
and values
. This method is equivalent to:
removeQueryParameter(key); for (T value : values) { query.addQueryParameter(key, value); }
setQueryParameters
in interface HttpRequestMetaData
key
- the query parameter key.values
- the query parameter values.this
.BlockingStreamingHttpRequest version(HttpProtocolVersion version)
HttpMetaData
HttpMetaData
.version
in interface HttpMetaData
version
in interface HttpRequestMetaData
version
- the protocol version to set.this
.BlockingStreamingHttpRequest method(HttpRequestMethod method)
HttpRequestMetaData
HttpRequestMethod
of this StreamingHttpRequest
.method
in interface HttpRequestMetaData
method
- the HttpRequestMethod
to set.this
.BlockingStreamingHttpRequest requestTarget(java.lang.String requestTarget)
HttpRequestMetaData
This 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 HttpRequestMetaData
requestTarget
- the percent-encoded
request-target to set.this
.default BlockingStreamingHttpRequest addHeader(java.lang.CharSequence name, java.lang.CharSequence value)
HttpMetaData
name
and value
.addHeader
in interface HttpMetaData
addHeader
in interface HttpRequestMetaData
name
- the name of the header.value
- the value of the header.this
.default BlockingStreamingHttpRequest addHeaders(HttpHeaders headers)
HttpMetaData
headers
object.addHeaders
in interface HttpMetaData
addHeaders
in interface HttpRequestMetaData
headers
- the headers to add.this
.default BlockingStreamingHttpRequest setHeader(java.lang.CharSequence name, java.lang.CharSequence value)
HttpMetaData
name
and value
. Any existing headers with the same name are
overwritten.setHeader
in interface HttpMetaData
setHeader
in interface HttpRequestMetaData
name
- the name of the header.value
- the value of the header.this
.default BlockingStreamingHttpRequest setHeaders(HttpHeaders headers)
HttpMetaData
headers
object.setHeaders
in interface HttpMetaData
setHeaders
in interface HttpRequestMetaData
headers
- the headers object which contains new values.this
.default BlockingStreamingHttpRequest addCookie(HttpCookiePair cookie)
HttpMetaData
This may result in multiple HttpCookiePair
s with same name.
addCookie
in interface HttpMetaData
addCookie
in interface HttpRequestMetaData
cookie
- the cookie to add.this
.default BlockingStreamingHttpRequest addCookie(java.lang.CharSequence name, java.lang.CharSequence value)
HttpMetaData
name
and
value
.
This may result in multiple HttpSetCookie
s 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 HttpMetaData
addCookie
in interface HttpRequestMetaData
name
- the name of the cookie.value
- the value of the cookie.this
.default BlockingStreamingHttpRequest addSetCookie(HttpSetCookie cookie)
HttpMetaData
This may result in multiple HttpSetCookie
s with same name.
addSetCookie
in interface HttpMetaData
addSetCookie
in interface HttpRequestMetaData
cookie
- the cookie to add.this
.default BlockingStreamingHttpRequest addSetCookie(java.lang.CharSequence name, java.lang.CharSequence value)
HttpMetaData
name
and value
.
This may result in multiple HttpSetCookie
s 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 HttpMetaData
addSetCookie
in interface HttpRequestMetaData
name
- the name of the cookie.value
- the value of the cookie.this
.