A simple interceptor for okhttp3 to add common paramters
repositories {
maven { url 'https://dl.bintray.com/leepood/maven' }
}
dependencies {
compile 'com.leepood:okhttp3-common-params-interceptor:v0.1'
}
HttpCommonParamsInterceptor interceptor = new HttpCommonParamsInterceptor.Builder()
.type(HttpCommonParamsInterceptor.Builder.Type.AUTO)
.params("f","android")
.params("weixin",0)
.params("v",8.4)
.build();
OkHttpClient httpClient = new OkHttpClient.Builder()
.addInterceptor(interceptor)
.connectTimeout(1, TimeUnit.MINUTES)
.build();