Solution 1 :
This will remove it for any request the client sends.
OkHttpClient client = new OkHttpClient.Builder()
.addNetworkInterceptor(chain -> chain.proceed(chain.request().newBuilder()
.removeHeader("user-agent")
.build()))
.build();
Problem :
I want to remove “User-Agent” property from my post httprequest.
I’m using okhttpclient.
Can anyone help me with snippet of code?
Comments
Comment posted by Sairaj Sawant
Any particular reason to not include User-agent?