I have this interceptor that i add to my OkHttp client:
public class RequestTokenInterceptor implements Interceptor {
@Override
public Response intercept(Cha
If you are using Retrofit library then you can directly pass header to api request using @Header annotation without use of Interceptor. Here is example that shows how to add header to Retrofit api request.
@POST(apiURL)
void methodName(
@Header(HeadersContract.HEADER_AUTHONRIZATION) String token,
@Header(HeadersContract.HEADER_CLIENT_ID) String token,
@Body TypedInput body,
Callback callback);
Hope it helps!