@Documented @Target(value=PARAMETER) @Retention(value=RUNTIME) public @interface QueryMap
Both keys and values are converted to strings using String.valueOf(Object). Values are
URL encoded and null will not include the query parameter in the URL. null keys
are not allowed.
Simple Example:
@GET("/search")
Call<ResponseBody> list(@QueryMap Map<String, String> filters);
Calling with foo.list(ImmutableMap.of("foo", "bar", "kit", "kat")) yields
/search?foo=bar&kit=kat.
Map keys and values representing parameter values are URL encoded by default. Specify
encoded=true to change this behavior.
@GET("/search")
Call<ResponseBody> list(@QueryMap(encoded=true) Map<String, String> filters);
Calling with foo.list(ImmutableMap.of("foo", "foo+bar")) yields
/search?foo=foo+bar.Query| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
encoded
Specifies whether parameter names and values are already URL encoded.
|
Copyright © 2016 Square, Inc.. All rights reserved.