@Documented @Retention(value=RUNTIME) @Target(value=PARAMETER) public @interface PathParam
String.valueOf(Object) and URL encoded.
Simple example:
@GET("/image/{id}")
void example(@Path("id") int id);
Calling with foo.example(1) yields /image/1.
Values are URL encoded by default. Disable with encode=false.
@GET("/user/{name}")
void encoded(@PathParam("name") String name);
@GET("/user/{name}")
void notEncoded(@PathParam(value="name", encode=false) String name);
Calling foo.encoded("John+Doe") yields /user/John%2BDoe whereas
foo.notEncoded("John+Doe") yields /user/John+Doe.
Path parameters may not be null.
| Modifier and Type | Required Element and Description |
|---|---|
String |
value |
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
encode
Specifies whether the argument value to the annotated method parameter is URL encoded.
|
public abstract String value
Copyright © 2021. All rights reserved.