public interface HttpRequestMetaData extends HttpMetaData
| Modifier and Type | Method and Description |
|---|---|
default HttpRequestMetaData |
addCookie(CharSequence name,
CharSequence value)
|
default HttpRequestMetaData |
addCookie(HttpCookiePair cookie)
Adds a cookie.
|
default HttpRequestMetaData |
addHeader(CharSequence name,
CharSequence value)
Adds a new header with the specified
name and value. |
default HttpRequestMetaData |
addHeaders(HttpHeaders headers)
Adds all header names and values of
headers object. |
HttpRequestMetaData |
addQueryParameter(String key,
String value)
Adds a new query parameter with the specified
key and value, which will be
percent-encoded if needed. |
HttpRequestMetaData |
addQueryParameters(String key,
Iterable<String> values)
Adds new query parameters with the specified
key and values. |
HttpRequestMetaData |
addQueryParameters(String key,
String... values)
Adds new query parameters with the specified
key and values. |
default HttpRequestMetaData |
addSetCookie(CharSequence name,
CharSequence value)
|
default HttpRequestMetaData |
addSetCookie(HttpSetCookie cookie)
Adds a set-cookie.
|
HttpRequestMetaData |
appendPathSegments(String... segments)
Appends segments to the current
path(), performing encoding of each segment
(including ('/') characters) according
to percent-encoding. |
String |
effectiveHost()
|
int |
effectivePort()
|
default boolean |
hasQueryParameter(String key)
Returns
true if a query parameter with the key exists, false otherwise. |
boolean |
hasQueryParameter(String key,
String value)
Returns
true if a query parameter with the key and value exists, false otherwise. |
String |
host()
The host component derived
from
requestTarget(). |
HttpRequestMethod |
method()
Returns the
HttpRequestMethod of this StreamingHttpRequest. |
HttpRequestMetaData |
method(HttpRequestMethod method)
Set the
HttpRequestMethod of this StreamingHttpRequest. |
String |
path()
Get an equivalent value as
rawPath() but decoded according
to percent-encoding. |
HttpRequestMetaData |
path(String path)
Sets the path, performing encoding according
to percent-encoding, except for forward-slash
(
'/') characters. |
int |
port()
The port component derived
from
requestTarget(). |
String |
queryParameter(String key)
Returns the value of a query parameter with the specified key.
|
Iterable<Map.Entry<String,String>> |
queryParameters()
Returns all query parameters as key/value pairs.
|
Iterable<String> |
queryParameters(String key)
Returns all values for the query parameter with the specified key.
|
Iterator<String> |
queryParametersIterator(String key)
Returns all values for the query parameter with the specified key.
|
Set<String> |
queryParametersKeys()
Returns a
Set of all query parameter keys. |
int |
queryParametersSize()
Returns the number of query parameters.
|
String |
rawPath()
The path component derived
from
requestTarget(). |
HttpRequestMetaData |
rawPath(String path)
Sets the path to
path, without any encoding performed. |
String |
rawQuery()
The query component derived
from
requestTarget(). |
HttpRequestMetaData |
rawQuery(String query)
Sets the query component to
query, without
any encoding performed. |
boolean |
removeQueryParameters(String key)
Removes all query parameters with the specified
key. |
boolean |
removeQueryParameters(String key,
String value)
Removes all query parameters with the specified
key and value. |
String |
requestTarget()
The request-target.
|
HttpRequestMetaData |
requestTarget(String requestTarget)
Set the request-target.
|
String |
scheme()
The scheme component derived
from
requestTarget() in lower case. |
default HttpRequestMetaData |
setHeader(CharSequence name,
CharSequence value)
Sets a header with the specified
name and value. |
default HttpRequestMetaData |
setHeaders(HttpHeaders headers)
Clears the current header entries and copies all header entries of the specified
headers object. |
HttpRequestMetaData |
setQueryParameter(String key,
String value)
|
HttpRequestMetaData |
setQueryParameters(String key,
Iterable<String> values)
Sets new query parameters with the specified
key and values. |
HttpRequestMetaData |
setQueryParameters(String key,
String... values)
Sets new query parameters with the specified
key and values. |
String |
userInfo()
The user information component derived
from
requestTarget(). |
HttpRequestMetaData |
version(HttpProtocolVersion version)
Set the protocol version of this
HttpMetaData. |
headers, toString, toString, versionHttpRequestMethod method()
HttpRequestMethod of this StreamingHttpRequest.HttpRequestMethod of this StreamingHttpRequestHttpRequestMetaData method(HttpRequestMethod method)
HttpRequestMethod of this StreamingHttpRequest.method - the HttpRequestMethod to set.this.String requestTarget()
No decoding has been done on the request-target.
No decoding has been done on the request-target.
HttpRequestMetaData requestTarget(String requestTarget)
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 path(), rawQuery(), etc.
requestTarget - the percent-encoded
request-target to set.this.@Nullable String scheme()
requestTarget() in lower case.requestTarget() in lower case, or null if none can be derived.@Nullable String userInfo()
requestTarget().requestTarget(), or null if none can be derived.@Nullable String host()
requestTarget().requestTarget(), or null if none can be derived.int port()
requestTarget().requestTarget(),
or <0 if none can be derived.String rawPath()
requestTarget().
No decoding has been done on the query component: the value is provided as specified in the request target.
requestTarget().
No decoding has been done on the query component: the value is provided as specified in the request target.
String path()
rawPath() but decoded according
to percent-encoding.rawPath() but decoded according
to percent-encoding.HttpRequestMetaData rawPath(String path)
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 requestTarget(String).
path - the encoded path to set.this.HttpRequestMetaData path(String path)
'/') characters. This allows for path("/abc") without it turning into
'%2Fabc'.path - the un-encoded path to set.this.HttpRequestMetaData appendPathSegments(String... segments)
path(), performing encoding of each segment
(including ('/') characters) according
to percent-encoding.
A / is used to separate each segment and between the current path() and the following segments.segments - the un-encoded path to set.this.String rawQuery()
requestTarget().
No decoding has been done on the query component: the value is provided as specified in the request target.
requestTarget().
No decoding has been done on the query component: the value is provided as specified in the request target.
HttpRequestMetaData rawQuery(String query)
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 requestTarget(String).
query - the encoded query to set.this.@Nullable String queryParameter(String key)
key - the key of the query parameter to retrieve.null if there's no such key.Iterable<Map.Entry<String,String>> queryParameters()
Iterable of query parameter key/value pairs or an empty Iterable if none present.Iterable<String> queryParameters(String key)
key - the key of the query parameter to retrieve.Iterable of query parameter values or an empty Iterable if no values are found.Iterator<String> queryParametersIterator(String key)
key - the key of the query parameter to retrieve.Iterator of query parameter values or an empty Iterator if no values are found.Set<String> queryParametersKeys()
Set of all query parameter keys. The returned Set cannot be modified.Set of all query parameter keys. The returned Set cannot be modified.default boolean hasQueryParameter(String key)
true if a query parameter with the key exists, false otherwise.key - the query parameter name.true if key exists.boolean hasQueryParameter(String key,
String value)
true if a query parameter with the key and value exists, false otherwise.key - the query parameter key.value - the query parameter value of the query parameter to find.true if a key, value pair exists.int queryParametersSize()
HttpRequestMetaData addQueryParameter(String key, String value)
key and value, which will be
percent-encoded if needed.key - the query parameter key.value - the query parameter value.this.HttpRequestMetaData addQueryParameters(String key, Iterable<String> values)
key and values. This method is semantically
equivalent to:
for (T value : values) {
addQueryParameter(key, value);
}
key - the query parameter key.values - the query parameter values.this.HttpRequestMetaData addQueryParameters(String key, String... values)
key and values. This method is semantically
equivalent to:
for (T value : values) {
query.addQueryParameter(key, value);
}
key - the query parameter key.values - the query parameter values.this.HttpRequestMetaData setQueryParameter(String key, String value)
key and value, which will be
percent-encoded if needed.
Any existing query parameters with the same key are overwritten.key - the query parameter key.value - the query parameter value.this.HttpRequestMetaData setQueryParameters(String key, Iterable<String> values)
key and values. This method is equivalent to:
removeQueryParameter(key);
for (T value : values) {
query.addQueryParameter(key, value);
}
key - the query parameter key.values - the query parameter values.this.HttpRequestMetaData setQueryParameters(String key, String... values)
key and values. This method is equivalent to:
removeQueryParameter(key);
for (T value : values) {
query.addQueryParameter(key, value);
}
key - the query parameter key.values - the query parameter values.this.boolean removeQueryParameters(String key)
key.key - the query parameter key.true if at least one entry has been removed.boolean removeQueryParameters(String key,
String value)
key and value.key - the query parameter key.value - the query parameter value.true if at least one entry has been removed.@Nullable String effectiveHost()
requestTarget() and the Host header field value. This is the scheme component to use
when computing an effective request URI.requestTarget() and the Host header field value, or null if none can be derived.int effectivePort()
requestTarget() and the Host header field value. This is the scheme component to use
when computing an effective request URI.requestTarget(), and the Host header field value, or <0 if none can be derived.HttpRequestMetaData version(HttpProtocolVersion version)
HttpMetaDataHttpMetaData.version in interface HttpMetaDataversion - the protocol version to set.this.default HttpRequestMetaData addHeader(CharSequence name, CharSequence value)
HttpMetaDataname and value.addHeader in interface HttpMetaDataname - the name of the header.value - the value of the header.this.default HttpRequestMetaData addHeaders(HttpHeaders headers)
HttpMetaDataheaders object.addHeaders in interface HttpMetaDataheaders - the headers to add.this.default HttpRequestMetaData setHeader(CharSequence name, CharSequence value)
HttpMetaDataname and value. Any existing headers with the same name are
overwritten.setHeader in interface HttpMetaDataname - the name of the header.value - the value of the header.this.default HttpRequestMetaData setHeaders(HttpHeaders headers)
HttpMetaDataheaders object.setHeaders in interface HttpMetaDataheaders - the headers object which contains new values.this.default HttpRequestMetaData addCookie(HttpCookiePair cookie)
HttpMetaData
This may result in multiple HttpCookiePairs with same name.
addCookie in interface HttpMetaDatacookie - the cookie to add.this.default HttpRequestMetaData 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 HttpMetaDataname - the name of the cookie.value - the value of the cookie.this.default HttpRequestMetaData addSetCookie(HttpSetCookie cookie)
HttpMetaData
This may result in multiple HttpSetCookies with same name.
addSetCookie in interface HttpMetaDatacookie - the cookie to add.this.default HttpRequestMetaData 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 HttpMetaDataname - the name of the cookie.value - the value of the cookie.this.