Interface RestTarget.Request
- Enclosing interface:
RestTarget
public static interface RestTarget.Request
Represents a request.
- Author:
- Holger Eichelberger, SSE
-
Method Summary
Modifier and TypeMethodDescriptionUpdates the request by appending path to the actual/original URI.addQueryParam(String name, String... values) Updates the request instance by configuring a query parameter on the current URI.Requests a JSON invocation.
-
Method Details
-
addPath
Updates the request by appending path to the actual/original URI. When constructing the final path, a '/' separator will be inserted between the existing path and the supplied path if necessary. Existing '/' characters are preserved thus a single value can represent multiple URI path segments.- Parameters:
path- the path, may contain URI template parameters- Returns:
- this for chaining, an updated request instance
- Throws:
NullPointerException- if path is null
-
addQueryParam
Updates the request instance by configuring a query parameter on the current URI. If multiple values are supplied the parameter will be added once per value. In case a singlenullvalue is entered, all parameters with that name are removed (if present) from the collection of query parameters inherited from the current target.- Parameters:
name- the query parameter name, may contain URI template parametersvalues- the query parameter value(s), each object will be converted to aStringusing itstoString()method. Stringified values may contain URI template parameters- Returns:
- a new target instance
- Throws:
NullPointerException- if the parameter name is null or if there are multiple values present and any of those values is null
-
requestJson
RestTarget.Invocation requestJson()Requests a JSON invocation.- Returns:
- the invocation instance.
-