I have a problem with getting authenticated user. Before it I got token and user id. Now i need to get user from server using access token and id. I have header format
Try to pass the header values via the method call:
@GET("driver/v1/driver")
Call<Driver> getAuthorizedDriver(@Header("authorization") String token,
@Header("driver_id") Integer id);
You also wouldn't have to deal with this huge chunk of Interceptor code
I got it. It's must look like:
@GET("driver/v1/driver")
Call<Driver> getAuthorizedDriver(@Header("authorization") String auth);
And auth:
Call<Driver> call = apiInterface.getAuthorizedDriver("Token token=" + token + ", driver_id=" + id);