Interface RestTarget.Request

Enclosing interface:
RestTarget

public static interface RestTarget.Request
Represents a request.
Author:
Holger Eichelberger, SSE
  • Method Details

    • addPath

      RestTarget.Request addPath(String path)
      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

      RestTarget.Request addQueryParam(String name, String... values)
      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 single null value 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 parameters
      values - the query parameter value(s), each object will be converted to a String using its toString() 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.