我正在尝试使用Retrofit2,我想添加Token到我的Header喜欢这个:
Authorization: Bearer Token
但code下面不起作用:
public interface APIService {
@Headers({"Authorization", "Bearer "+ token})
@GET("api/Profiles/GetProfile?id={id}")
Call<UserProfile> getUser(@Path("id") String id);
}
Run Code Online (Sandbox Code Playgroud)
我的服务器asp.net webApi
请帮忙我该怎么办?