Package com.couchbase.client.java.http
Class HttpPath
java.lang.Object
com.couchbase.client.java.http.HttpPath
Specifies the path for an HTTP request.
May also include the query string, if desired.
Create new instances using the static factory method.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic HttpPath
Returns a new path, substituting any "{}" placeholders in the template with the corresponding argument.static HttpPath
Likeof(String, String...)
but takes the arguments as a list instead of varargs.toString()
-
Method Details
-
of
Returns a new path, substituting any "{}" placeholders in the template with the corresponding argument.Placeholder values are automatically URL-encoded.
Example usage:
HttpPath path = HttpPath.of("/foo/{}/bar/{}", "hello world", "xyzzy"); System.out.println(path);
Output:/foo/hello%20world/bar/xyzzy
- Parameters:
template
- The template string, which may include "{}" placeholders.args
- un-encoded values to substitute for the placeholders. Values are automatically URL-encoded during the substitution process.- Throws:
IllegalArgumentException
- if the number of placeholders does not match the number of arguments.- See Also:
-
of
Likeof(String, String...)
but takes the arguments as a list instead of varargs.- See Also:
-
toString
-