Interface ApiRequest<T extends ApiRequest<T>>

    • Method Detail

      • addHeader

        T addHeader​(String name,
                    String... value)
        Add an HTTP header.
        Parameters:
        name - name of the header
        value - header value(s)
        Returns:
        updated request
      • addQueryParam

        T addQueryParam​(String name,
                        String... value)
        Add an HTTP query parameter.
        Parameters:
        name - name of the parameter
        value - parameter value(s)
        Returns:
        updated request
      • requestId

        T requestId​(String requestId)
        Configure request ID for logging (and possibly to send over the network).
        Parameters:
        requestId - request id
        Returns:
        updated request
      • headers

        Map<String,​List<String>> headers()
        Returns immutable configured headers.
        Returns:
        headers configured for this request
      • queryParams

        Map<String,​List<String>> queryParams()
        Returns immutable configured query parameters.
        Returns:
        query parameters configured for this request
      • toJson

        default Optional<JsonObject> toJson​(JsonBuilderFactory factory)
        Return the JSON object used for POST and PUT requests (and other methods if needed). The default implementation returns an empty optional that can be used for GET, HEAD, DELETE methods (and other methods without an entity).
        Parameters:
        factory - builder factory to construct JSON object
        Returns:
        JSON if available on this request
      • requestId

        Optional<String> requestId()
        Configured request ID.
        Returns:
        request ID if configured