I am using okhttp 2.0 in my Android app and didn\'t find a way to set some common User Agent for all outgoing requests.
I thought I could do something like
In case anyone is looking for this working with OkHttp 3 and in Kotlin:
val client = OkHttpClient.Builder() .addNetworkInterceptor { chain -> chain.proceed( chain.request() .newBuilder() .header("User-Agent", "COOL APP 9000") .build() ) } .build()