retrofit / retrofit2.http / Header

Header

@Target([AnnotationTarget.VALUE_PARAMETER]) class Header

Replaces the header with the value of its target.


  @GET("/")
  Call<ResponseBody> foo(@Header("Accept-Language") String lang);
  
Header parameters may be null which will omit them from the request. Passing a or array will result in a header for each non-null item.

Note: Headers do not overwrite each other. All headers with the same name will be included in the request.

See Also
HeadersHeaderMap

Constructors

<init>

Header(value: String)

Replaces the header with the value of its target.


  @GET("/")
  Call<ResponseBody> foo(@Header("Accept-Language") String lang);
  
Header parameters may be null which will omit them from the request. Passing a or array will result in a header for each non-null item.

Properties

value

val value: String