@Documented
@Retention(value=RUNTIME)
@Target(value=PARAMETER)
public static @interface Retrofit.Path
String.valueOf(Object) and URL encoded.
@GET|@PUT|@POST|@DELETE(@Path)
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(@Path("name") String name);
@GET("/user/{name}")
void notEncoded(@Path(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 |
|---|---|
java.lang.String |
value |
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
encode
Specifies whether the argument value to the annotated method parameter is URL encoded.
|