@Documented
@Retention(value=RUNTIME)
@Target(value=PARAMETER)
public @interface Header
@GET("/")
Call<ResponseBody> foo(@Header("Accept-Language") String lang);
Header parameters may be null which will omit them from the request. Passing a List or array will result in a header for each non-null item.
Parameter keys and values only allows ascii values by default. Specify allowUnsafeNonAsciiValues=true to change this behavior.
@GET("/")
Call<ResponseBody> foo(@Header("Accept-Language", allowUnsafeNonAsciiValues=true) String lang);
Note: Headers do not overwrite each other. All headers with the same name will be included in the request.
| Modifier and Type | Required Element and Description |
|---|---|
java.lang.String |
value
The query parameter name.
|
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
allowUnsafeNonAsciiValues
Specifies whether the parameter name and value are already URL encoded.
|
public abstract boolean allowUnsafeNonAsciiValues