I'm using retrofit to make requests.
I've got following error:
java.net.ProtocolException: Too many follow-up requests: 21
The code is like below:
private OkHttpClient httpClient;
private CookieManager cookieManager;
public <S> S createCookieService(Class<S> serviceClass) {
httpClient.interceptors().clear();
httpClient.setCookieHandler(cookieManager);
Retrofit.Builder builder = new Retrofit
.Builder()
.client(httpClient)
.baseUrl(url)
.addConverterFactory(GsonConverterFactory.create());
Retrofit retrofit = builder.client(httpClient).build();
return retrofit.create(serviceClass);
}
And then I'm making requests:
example:
1) login
@POST("/login")
Call<User> login();
2) some request:
@GET("/request")
Call<PojoPojo> getPojo();
And I'm getting this error too many follow-up requests: 21.
Please help.