Annotation Interface Url
Identifies a method parameter on a REST proxy interface whose value supplies the entire request URL (or a
root-relative URL) for that single call — the Retrofit
Arguments of client-side @Remote-annotated interfaces
When the bound argument is non-
-
If the value contains a scheme (e.g.
"http://other-host/path" ) it is treated as an absolute URL that replaces the whole computed endpoint and bypasses the client root URL. -
If the value has no scheme (e.g.
"/other/path" ) it is treated as a relative URL resolved against the client root URL only — not against the interfaceRemote.path()(matching Retrofit "endpoint replacement").
Any @Path parameters, so a
caller-supplied URL may contain path templates. An Remote.path() + @RemoteOp(path=...) and over any declarative
baseUrl override.
Example:
Notes:
-
At most one
@Url parameter is allowed per method (validated at proxy-build time). -
A
null or blank@Url argument is rejected with anIllegalArgumentException. -
Only
http /https schemes are permitted; other schemes (e.g.file: ,gopher: ) are rejected (SSRF guardrail). -
Honored by both the next-generation engine (
RestClient.remote(...) ) and the classic engine (RestClient.getRemote(...) ), with the same http/https-only scheme guard on both.
See Also:
- Since:
- 9.2.1