@Target(value=METHOD) @Retention(value=RUNTIME) public @interface RequestLine
value, permitting path and query variables, or
just the http method. Templates should conform to RFC 6570. Support is limited to Simple String
expansion and Reserved Expansion (Level 1 and Level 2) expressions.| Modifier and Type | Required Element and Description |
|---|---|
String |
value
The HTTP request line, including the method and an optional URI template.
|
| Modifier and Type | Optional Element and Description |
|---|---|
CollectionFormat |
collectionFormat
Specifies how collections (e.g.
|
boolean |
decodeSlash
Controls whether percent-encoded forward slashes (
%2F) in expanded path variables are
decoded back to '/' before sending the request. |
public abstract String value
The string must begin with a valid HTTP method name
(e.g. GET, POST, PUT), followed by a space and a URI template.
If only the HTTP method is specified (e.g. "DELETE"), the request will use the base URL
defined for the client.
Example:
@RequestLine("GET /repos/{owner}/{repo}")
Repo getRepo(@Param("owner") String owner, @Param("repo") String repo);
UriTemplatepublic abstract boolean decodeSlash
%2F) in expanded path variables are
decoded back to '/' before sending the request.
When true (the default), any %2F sequences produced during URI template
expansion will be replaced with literal slashes, meaning that path variables containing slashes
will be interpreted as multiple path segments.
When false, percent-encoded slashes (%2F) are preserved in the final URL.
This is useful when a path variable intentionally includes a slash as part of its value (for
example, an encoded identifier such as "foo%2Fbar").
Example:
@RequestLine(value = "GET /projects/{id}", decodeSlash = false)
Project getProject(@Param("id") String encodedId);
true if encoded slashes should be decoded (default behavior); false to
preserve %2F sequences in the URL.public abstract CollectionFormat collectionFormat
List or arrays) are serialized when
expanded into the URI template.
Determines whether values are represented as exploded parameters (repeated keys) or as a
single comma-separated value, depending on the chosen CollectionFormat.
Example:
CollectionFormatCopyright © 2012–2026 OpenFeign. All rights reserved.