Skip to content

Headers

Orhan Obut edited this page Aug 9, 2015 · 2 revisions

@Header is used to add headers by using params

    @GET("/repos")
    void fetchRepos(
          @Header("auth") String authToken,
          RepoCallBack<List<Repo> callBack
    );

@Headers is used to add static headers by adding to method

    //Single static header
    @Headers("Accept-Language:en-En")
    @GET("/users")
    void fetchUsers(
          Callback<List<User> callback
    );

    // Multiple static headers
    @Headers({
        "Accept-Language:en-En",
        "Content-type:application/json"
    })
Clone this wiki locally