How to specify a default user agent for okhttp 2.x requests
You can use an interceptor to add the User-Agent header to all your requests. For more information about okHttp interceptors see http://square.github.io/okhttp/interceptors/ Example implementation of this interceptor: /* This interceptor adds a custom User-Agent. */ public class UserAgentInterceptor implements Interceptor { private final String userAgent; public UserAgentInterceptor(String userAgent) { this.userAgent = userAgent; } @Override public … Read more