public interface StreamingHttpRequest extends HttpRequestMetaData
HttpRequest but provides the payload as a Publisher.| Modifier and Type | Method and Description |
|---|---|
default StreamingHttpRequest |
addCookie(CharSequence name,
CharSequence value)
|
default StreamingHttpRequest |
addCookie(HttpCookiePair cookie)
Adds a cookie.
|
default StreamingHttpRequest |
addHeader(CharSequence name,
CharSequence value)
Adds a new header with the specified
name and value. |
default StreamingHttpRequest |
addHeaders(HttpHeaders headers)
Adds all header names and values of
headers object. |
StreamingHttpRequest |
addQueryParameter(String key,
String value)
Adds a new query parameter with the specified
key and value, which will be
percent-encoded if needed. |
StreamingHttpRequest |
addQueryParameters(String key,
Iterable<String> values)
Adds new query parameters with the specified
key and values. |
StreamingHttpRequest |
addQueryParameters(String key,
String... values)
Adds new query parameters with the specified
key and values. |
default StreamingHttpRequest |
addSetCookie(CharSequence name,
CharSequence value)
|
default StreamingHttpRequest |
addSetCookie(HttpSetCookie cookie)
Adds a set-cookie.
|
StreamingHttpRequest |
appendPathSegments(String... segments)
Appends segments to the current
HttpRequestMetaData.path(), performing encoding of each segment
(including ('/') characters) according
to percent-encoding. |
StreamingHttpRequest |
encoding(ContentCodec encoding)
The
ContentCodec used to encode the payload of a request or a response. |
StreamingHttpRequest |
method(HttpRequestMethod method)
Set the
HttpRequestMethod of this StreamingHttpRequest. |
StreamingHttpRequest |
path(String path)
Sets the path, performing encoding according
to percent-encoding, except for forward-slash
(
'/') characters. |
Publisher<Buffer> |
payloadBody()
Gets the underlying payload as a
Publisher of Buffers. |
default <T> Publisher<T> |
payloadBody(HttpDeserializer<T> deserializer)
Gets and deserializes the payload body.
|
StreamingHttpRequest |
payloadBody(Publisher<Buffer> payloadBody)
Returns a
StreamingHttpRequest with its underlying payload set to payloadBody. |
<T> StreamingHttpRequest |
payloadBody(Publisher<T> payloadBody,
HttpSerializer<T> serializer)
Returns a
StreamingHttpRequest with its underlying payload set to the result of serialization. |
Publisher<Object> |
payloadBodyAndTrailers()
Gets a
Publisher that combines the raw payload body concatenated with the trailers. |
StreamingHttpRequest |
query(String query)
Sets the path, performing encoding according
to rfc3986, Query.
|
StreamingHttpRequest |
rawPath(String path)
Sets the path to
path, without any encoding performed. |
StreamingHttpRequest |
rawQuery(String query)
Sets the query component to
query, without
any encoding performed. |
StreamingHttpRequest |
requestTarget(String requestTarget)
Set the request-target.
|
StreamingHttpRequest |
requestTarget(String requestTarget,
Charset encoding)
Set the request-target.
|
default StreamingHttpRequest |
setHeader(CharSequence name,
CharSequence value)
Sets a header with the specified
name and value. |
default StreamingHttpRequest |
setHeaders(HttpHeaders headers)
Clears the current header entries and copies all header entries of the specified
headers object. |
StreamingHttpRequest |
setQueryParameter(String key,
String value)
|
StreamingHttpRequest |
setQueryParameters(String key,
Iterable<String> values)
Sets new query parameters with the specified
key and values. |
StreamingHttpRequest |
setQueryParameters(String key,
String... values)
Sets new query parameters with the specified
key and values. |
BlockingStreamingHttpRequest |
toBlockingStreamingRequest()
Translate this
StreamingHttpRequest to a BlockingStreamingHttpRequest. |
Single<HttpRequest> |
toRequest()
Translates this
StreamingHttpRequest to a HttpRequest. |
<T> StreamingHttpRequest |
transform(TrailersTransformer<T,Buffer> trailersTransformer)
Returns a
StreamingHttpRequest with its underlying payload transformed to Buffers,
with access to the trailers. |
<T> StreamingHttpRequest |
transformPayloadBody(Function<Publisher<Buffer>,Publisher<T>> transformer,
HttpSerializer<T> serializer)
Returns a
StreamingHttpRequest with its underlying payload transformed to the result of serialization. |
default <T,R> StreamingHttpRequest |
transformPayloadBody(Function<Publisher<T>,Publisher<R>> transformer,
HttpDeserializer<T> deserializer,
HttpSerializer<R> serializer)
Returns a
StreamingHttpRequest with its underlying payload transformed to the result of serialization. |
StreamingHttpRequest |
transformPayloadBody(UnaryOperator<Publisher<Buffer>> transformer)
Returns a
StreamingHttpRequest with its underlying payload transformed to Buffers. |
<T> StreamingHttpRequest |
transformRaw(TrailersTransformer<T,Object> trailersTransformer)
Returns a
StreamingHttpRequest with its underlying payload transformed to Objects,
with access to the trailers. |
StreamingHttpRequest |
transformRawPayloadBody(UnaryOperator<Publisher<?>> transformer)
Returns a
StreamingHttpRequest with its underlying payload transformed. |
StreamingHttpRequest |
version(HttpProtocolVersion version)
Set the protocol version of this
HttpMetaData. |
effectiveHostAndPort, hasQueryParameter, hasQueryParameter, host, method, path, port, query, queryParameter, queryParameters, queryParameters, queryParametersIterator, queryParametersKeys, queryParametersSize, rawPath, rawQuery, removeQueryParameters, removeQueryParameters, requestTarget, requestTarget, scheme, userInfoPublisher<Buffer> payloadBody()
Publisher of Buffers.Publisher of Buffer representation of the underlyingdefault <T> Publisher<T> payloadBody(HttpDeserializer<T> deserializer)
T - The resulting type of the deserialization operation.deserializer - The function that deserializes the underlying Publisher.Publisher<Object> payloadBodyAndTrailers()
Publisher that combines the raw payload body concatenated with the trailers.Publisher that combines the raw payload body concatenated with the
trailers.StreamingHttpRequest payloadBody(Publisher<Buffer> payloadBody)
StreamingHttpRequest with its underlying payload set to payloadBody.
A best effort will be made to apply back pressure to the existing Publisher 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 Publisher payload body.
payloadBody - The new payload body.this<T> StreamingHttpRequest payloadBody(Publisher<T> payloadBody, HttpSerializer<T> serializer)
StreamingHttpRequest with its underlying payload set to the result of serialization.
A best effort will be made to apply back pressure to the existing Publisher 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 Publisher 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> StreamingHttpRequest transformPayloadBody(Function<Publisher<Buffer>,Publisher<T>> transformer, HttpSerializer<T> serializer)
StreamingHttpRequest 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 Publisher and
returns the new payload body Publisher prior to serialization. It is assumed the existing payload body
Publisher will be transformed/consumed or else no more requests may be processed.serializer - Used to serialize the payload body.thisdefault <T,R> StreamingHttpRequest transformPayloadBody(Function<Publisher<T>,Publisher<R>> transformer, HttpDeserializer<T> deserializer, HttpSerializer<R> serializer)
StreamingHttpRequest 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 Publisher and
returns the new payload body Publisher prior to serialization. It is assumed the existing payload body
Publisher 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.thisStreamingHttpRequest transformPayloadBody(UnaryOperator<Publisher<Buffer>> transformer)
StreamingHttpRequest with its underlying payload transformed to Buffers.transformer - A UnaryOperator which take as a parameter the existing payload body Publisher
and returns the new payload body Publisher. It is assumed the existing payload body Publisher
will be transformed/consumed or else no more requests may be processed.thisStreamingHttpRequest transformRawPayloadBody(UnaryOperator<Publisher<?>> transformer)
StreamingHttpRequest with its underlying payload transformed. Note that the raw objects of the
underlying Publisher may be exposed. The object types are not guaranteed to be homogeneous.transformer - Responsible for transforming the payload body.this<T> StreamingHttpRequest transform(TrailersTransformer<T,Buffer> trailersTransformer)
StreamingHttpRequest 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> StreamingHttpRequest transformRaw(TrailersTransformer<T,Object> trailersTransformer)
StreamingHttpRequest 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()
StreamingHttpRequest to a HttpRequest.Single that completes with a HttpRequest representation of this
StreamingHttpRequest.BlockingStreamingHttpRequest toBlockingStreamingRequest()
StreamingHttpRequest to a BlockingStreamingHttpRequest.BlockingStreamingHttpRequest representation of this StreamingHttpRequest.StreamingHttpRequest 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.StreamingHttpRequest 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.StreamingHttpRequest 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.StreamingHttpRequest rawQuery(@Nullable 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. null will clear the query value (e.g. no ? present in
HttpRequestMetaData.requestTarget().this.StreamingHttpRequest query(@Nullable String query)
HttpRequestMetaDataquery in interface HttpRequestMetaDataquery - the un-encoded query to set. null will clear the query value (e.g. no ? present in
HttpRequestMetaData.requestTarget().this.StreamingHttpRequest 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.StreamingHttpRequest 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.StreamingHttpRequest 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.StreamingHttpRequest 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.StreamingHttpRequest 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.StreamingHttpRequest 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.StreamingHttpRequest version(HttpProtocolVersion version)
HttpMetaDataHttpMetaData.version in interface HttpMetaDataversion in interface HttpRequestMetaDataversion - the protocol version to set.this.StreamingHttpRequest method(HttpRequestMethod method)
HttpRequestMetaDataHttpRequestMethod of this StreamingHttpRequest.method in interface HttpRequestMetaDatamethod - the HttpRequestMethod to set.this.StreamingHttpRequest encoding(ContentCodec encoding)
HttpMetaDataContentCodec used to encode the payload of a request or a response.
If the endpoint is setup with ContentCodingHttpServiceFilter, the server will
auto-establish the accepted encoding for the response, unless the caller provides a specific encoding
by calling this method.
Any encoding passed here, takes precedence. In other words, a compressed response, can
be disabled by passing ContentCodings.identity().encoding in interface HttpMetaDataencoding - The ContentCodec used for the encoding of the payload.this.StreamingHttpRequest 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.StreamingHttpRequest requestTarget(String requestTarget, Charset encoding)
HttpRequestMetaData
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
request-target to set.encoding - the Charset to use to
encode requestTarget before setting the
value.this.default StreamingHttpRequest 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 StreamingHttpRequest addHeaders(HttpHeaders headers)
HttpMetaDataheaders object.addHeaders in interface HttpMetaDataaddHeaders in interface HttpRequestMetaDataheaders - the headers to add.this.default StreamingHttpRequest 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 StreamingHttpRequest setHeaders(HttpHeaders headers)
HttpMetaDataheaders object.setHeaders in interface HttpMetaDatasetHeaders in interface HttpRequestMetaDataheaders - the headers object which contains new values.this.default StreamingHttpRequest 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 StreamingHttpRequest 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 StreamingHttpRequest 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 StreamingHttpRequest 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.