public static interface RestClient.RequestDefinition extends RestClient.Invocation, Serializable
| Modifier and Type | Method and Description |
|---|---|
RestClient.RequestDefinition |
accept(MediaType... mediaTypes)
Set the accepted response media types using
MediaType enumeration. |
RestClient.RequestDefinition |
accept(String... mediaTypes)
Set the accepted response media types.
|
RestClient.RequestDefinition |
acceptCharset(Charset... charsets)
Set the acceptable charsets.
|
RestClient.RequestDefinition |
acceptCharset(String... charsets)
Set the acceptable charsets.
|
RestClient.RequestDefinition |
acceptEncoding(String... encodings)
Set the acceptable encodings.
|
RestClient.RequestDefinition |
acceptLanguage(Locale... locales)
Set the acceptable languages.
|
RestClient.RequestDefinition |
acceptLanguage(String... locales)
Set the acceptable languages.
|
RestClient.RequestDefinition |
authorizationBasic(String username,
String password)
Add an
HttpHeaders.AUTHORIZATION header to request with scheme HttpHeaders.SCHEME_BASIC using
given username and password. |
RestClient.RequestDefinition |
authorizationBearer(String bearerToken)
Add an
HttpHeaders.AUTHORIZATION header to request with scheme HttpHeaders.SCHEME_BEARER
using given bearer token. |
RestClient.RequestDefinition |
cacheControl(CacheControl cacheControl)
Set the Cache-Control header.
|
Optional<URI> |
getBaseRequestURI()
Get the request base URI
|
Map<String,String> |
getHeaders()
Get the request headers
|
Optional<PropertySet<?>> |
getPropertySet()
Get the
PropertySet to use to deserialize any PropertyBox contained in the response payload |
Map<String,Object[]> |
getQueryParameters()
Get the URI query parameters
|
Optional<String> |
getRequestPath()
Get the request path to append to the base URI.
|
String |
getRequestURI()
Get the full request URI, composed by
getBaseRequestURI() and getRequestPath(), including
any (not resolved) template parameter. |
Map<String,Object> |
getTemplateParameters()
Get the URI template parameters to resolve
|
RestClient.RequestDefinition |
header(String name,
String... values)
Add a request header.
|
RestClient.RequestDefinition |
path(String path)
Append given
path to the request URI. |
<P extends Property> |
propertySet(Iterable<P> properties)
Use given
Property set to perform invocation. |
<P extends Property> |
propertySet(P... properties)
Use given
Property set to perform invocation. |
RestClient.RequestDefinition |
queryParameter(String name,
Object... values)
Add a query parameter to the request URI.
|
RestClient.RequestDefinition |
resolve(Map<String,Object> nameAndValues)
Resolve one or more a URI templates in the request URI using supplied name-value pairs.
|
RestClient.RequestDefinition |
resolve(String name,
Object value)
Resolve a URI template with given
name in the request URI using a supplied value. |
default RestClient.RequestDefinition |
target(String baseUri)
Set request base URI.
|
RestClient.RequestDefinition |
target(URI baseUri)
Set request base URI.
|
delete, delete, delete, deleteForEntity, deleteForEntity, deleteOrFail, get, get, getAsList, getForEntity, getForEntity, getForStream, head, invoke, invokeForEntity, invokeForSuccess, options, options, options, optionsForEntity, optionsForEntity, patch, patch, patch, patchForEntity, patchForEntity, post, post, post, postForEntity, postForEntity, postForLocation, put, put, put, putForEntity, putForEntity, trace, trace, trace, traceForEntity, traceForEntityRestClient.RequestDefinition target(URI baseUri)
path(String) to add URI paths
to base uri with template parameters support.baseUri - Request base URI (not null)default RestClient.RequestDefinition target(String baseUri)
path(String) to add URI paths
to base uri with template parameters support.baseUri - Request base URI (not null)RestClient.RequestDefinition path(String path)
path to the request URI.
May contain URI template parameters, resolved using the values supplied by resolve(String, Object)
methods.
A '/' separator will be inserted between the existing path and the supplied path if necessary.
path - The path to append, may contain URI template parametersRestClient.RequestDefinition queryParameter(String name, Object... values)
name - Query parameter name (not null)values - Query parameter value(s)IllegalArgumentException - If the supplied query parameter name is nullRestClient.RequestDefinition resolve(String name, Object value)
name in the request URI using a supplied value.name - Name of the URI template (not null)value - Value to be used to resolve the template (not null)IllegalArgumentException - If the supplied name or value is nullRestClient.RequestDefinition resolve(Map<String,Object> nameAndValues)
nameAndValues - A map of URI template names and their valuesIllegalArgumentException - If the name-value map or any of the names or values in the map is
nullRestClient.RequestDefinition accept(String... mediaTypes)
A HttpHeaders.ACCEPT header will be added to request with given values.
mediaTypes - Accepted response media typesRestClient.RequestDefinition accept(MediaType... mediaTypes)
MediaType enumeration. Any previous value will be
replaced.
A HttpHeaders.ACCEPT header will be added to request with given values.
mediaTypes - Accepted response media types.RestClient.RequestDefinition acceptLanguage(Locale... locales)
A HttpHeaders.ACCEPT_LANGUAGE header will be added to request with given values.
locales - Acceptable languages LocaleRestClient.RequestDefinition acceptLanguage(String... locales)
A HttpHeaders.ACCEPT_LANGUAGE header will be added to request with given values.
locales - Acceptable languagesRestClient.RequestDefinition acceptEncoding(String... encodings)
A HttpHeaders.ACCEPT_ENCODING header will be added to request with given values.
encodings - Acceptable encodingsRestClient.RequestDefinition acceptCharset(String... charsets)
A HttpHeaders.ACCEPT_CHARSET header will be added to request with given values.
charsets - Acceptable charsetsRestClient.RequestDefinition acceptCharset(Charset... charsets)
A HttpHeaders.ACCEPT_CHARSET header will be added to request with given values.
charsets - Acceptable charsetsRestClient.RequestDefinition cacheControl(CacheControl cacheControl)
cacheControl - the cache control directivesRestClient.RequestDefinition authorizationBearer(String bearerToken)
HttpHeaders.AUTHORIZATION header to request with scheme HttpHeaders.SCHEME_BEARER
using given bearer token.bearerToken - Bearer token to set in authorization header (not null)RestClient.RequestDefinition authorizationBasic(String username, String password)
HttpHeaders.AUTHORIZATION header to request with scheme HttpHeaders.SCHEME_BASIC using
given username and password.username - Username (not null)password - Password (not null)RestClient.RequestDefinition header(String name, String... values)
name is already defined, it will be replaced by
the new value.name - Name of the headervalues - Value of the header. If multiple values are supplied, the actual header value will be composed
by the given values in the specified order separated by a ,<P extends Property> RestClient.RequestDefinition propertySet(Iterable<P> properties)
Property set to perform invocation. Can be used for PropertyBox deserialization
when expected response payload contains serialized PropertyBox data.P - Actual property typeproperties - Property set to use (not null)<P extends Property> RestClient.RequestDefinition propertySet(P... properties)
Property set to perform invocation. Can be used for PropertyBox deserialization
when expected response payload contains serialized PropertyBox data.P - Actual property typeproperties - Property set to use (not null)Optional<URI> getBaseRequestURI()
Optional<String> getRequestPath()
String getRequestURI()
getBaseRequestURI() and getRequestPath(), including
any (not resolved) template parameter.Map<String,Object> getTemplateParameters()
Map<String,Object[]> getQueryParameters()
Map<String,String> getHeaders()
Optional<PropertySet<?>> getPropertySet()
PropertySet to use to deserialize any PropertyBox contained in the response payloadCopyright © 2017 The Holon Platform. All rights reserved.