@Documented
@Target(value=PARAMETER)
@Retention(value=RUNTIME)
public @interface QueryName
Passing a List
or array will result in a query parameter for each
non-null
item.
Simple Example:
@GET("/friends")
Call<ResponseBody> friends(@QueryName String filter);
Calling with foo.friends("contains(Bob)")
yields /friends?contains(Bob)
.
Array/Varargs Example:
@GET("/friends")
Call<ResponseBody> friends(@QueryName String... filters);
Calling with foo.friends("contains(Bob)", "age(42)")
yields /friends?contains(Bob)&age(42)
.
Parameter names are URL encoded by default. Specify encoded=true
to change
this behavior.
@GET("/friends")
Call<ResponseBody> friends(@QueryName(encoded=true) String filter);
Calling with foo.friends("name+age"))
yields /friends?name+age
.Modifier and Type | Optional Element and Description |
---|---|
boolean |
encoded
Specifies whether the parameter is already URL encoded.
|