@Documented
@Target(value=PARAMETER)
@Retention(value=RUNTIME)
public @interface HeaderMap
Map or Headers.
Values in the map are converted to strings using Retrofit.stringConverter(Type,
Annotation[]) (or Object.toString(), if no matching string converter is installed).
Simple Example:
@GET("/search")
void list(@HeaderMap Map<String, String> headers);
...
// The following call yields /search with headers
// Accept: text/plain and Accept-Charset: utf-8
foo.list(ImmutableMap.of("Accept", "text/plain", "Accept-Charset", "utf-8"));
Map keys and values representing parameter values allow only ascii values by default.
Specify allowUnsafeNonAsciiValues=true to change this behavior.
@GET("/search")
void list(@HeaderMap(allowUnsafeNonAsciiValues=true) Map<String, String> headers);
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
allowUnsafeNonAsciiValues
Specifies whether the parameter values are allowed with unsafe non ascii values.
|