I'm using Retrofit2 to consume the json. when I do login a bearer token is generated and saved into SharedPrefenences. I want to use this bearer token as Authentication header. and everytime I used it the response message was "Unauthorized"
here's my Request:
@GET("user/wishlist")
Call<WishListModel> getWishList(@Header("Authorization") String BearerToken);
and here's the call:
Retrofit retrofit = new Retrofit.Builder().baseUrl("URL").addConverterFactory(GsonConverterFactory.create()).build();
RequestInterface requestInterface = retrofit.create(RequestInterface.class);
Call<WishListModel> call = requestInterface.getWishList("Bearer "+token);